blob: 583cc2b07f3998e362d9958e609cd25c2d129cbc [file] [edit]
package templates
import (
"bytes"
"testing"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
func TestNewParse(t *testing.T) {
tm, err := NewParse("foo", "this is a {{ . }}")
assert.Check(t, err)
var b bytes.Buffer
assert.Check(t, tm.Execute(&b, "string"))
want := "this is a string"
assert.Check(t, is.Equal(want, b.String()))
}