package engine_test import ( "bytes" "context" "testing" "github.com/stretchr/testify/require" "gitoa.ru/go-4devs/templating/gohtml/engine" "gitoa.ru/go-4devs/templating/loader" ) func TestParser(t *testing.T) { t.Parallel() ctx := context.Background() buff := bytes.Buffer{} tpl, err := engine.Parser(loader.NewSource(t.Name(), `engine:{{.name}}`)) require.NoError(t, err) require.NoError(t, tpl.Execute(ctx, &buff, map[string]string{"name": "gohtml"}, nil)) require.Equal(t, "engine:gohtml", buff.String()) }