v1.16.0
ADDED: * tplx/sprigx
This commit is contained in:
33
tplx/sprigx/funcs_test.go
Normal file
33
tplx/sprigx/funcs_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package sprigx
|
||||
|
||||
import (
|
||||
`bytes`
|
||||
_ "embed"
|
||||
"testing"
|
||||
`text/template`
|
||||
|
||||
"github.com/Masterminds/sprig/v3"
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed "_test.tpl"
|
||||
testTplBytes []byte
|
||||
testTpl *template.Template = template.Must(
|
||||
template.
|
||||
New("").
|
||||
Funcs(sprig.TxtFuncMap()).
|
||||
Funcs(TxtFuncMap()).
|
||||
Parse(string(testTplBytes)),
|
||||
)
|
||||
)
|
||||
|
||||
func TestFuncs(t *testing.T) {
|
||||
|
||||
var err error
|
||||
var buf *bytes.Buffer = new(bytes.Buffer)
|
||||
|
||||
if err = testTpl.Execute(buf, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(buf.String())
|
||||
}
|
||||
Reference in New Issue
Block a user