...

Source file src/github.com/go-task/slim-sprig/v3/functions_linux_test.go

Documentation: github.com/go-task/slim-sprig/v3

     1  package sprig
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestOsBase(t *testing.T) {
    10  	assert.NoError(t, runt(`{{ osBase "foo/bar" }}`, "bar"))
    11  }
    12  
    13  func TestOsDir(t *testing.T) {
    14  	assert.NoError(t, runt(`{{ osDir "foo/bar/baz" }}`, "foo/bar"))
    15  }
    16  
    17  func TestOsIsAbs(t *testing.T) {
    18  	assert.NoError(t, runt(`{{ osIsAbs "/foo" }}`, "true"))
    19  	assert.NoError(t, runt(`{{ osIsAbs "foo" }}`, "false"))
    20  }
    21  
    22  func TestOsClean(t *testing.T) {
    23  	assert.NoError(t, runt(`{{ osClean "/foo/../foo/../bar" }}`, "/bar"))
    24  }
    25  
    26  func TestOsExt(t *testing.T) {
    27  	assert.NoError(t, runt(`{{ osExt "/foo/bar/baz.txt" }}`, ".txt"))
    28  }
    29  

View as plain text