1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 06:59:03 +01:00
liquid/liquid_test.go

19 lines
534 B
Go
Raw Normal View History

2017-07-05 20:24:15 +02:00
package liquid
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestIsTemplateError(t *testing.T) {
_, err := NewEngine().ParseAndRenderString("{{ syntax error }}", emptyBindings)
2017-07-15 19:29:53 +02:00
require.Error(t, err)
2017-07-05 20:24:15 +02:00
_, err = NewEngine().ParseAndRenderString("{% if %}", emptyBindings)
2017-07-15 19:29:53 +02:00
require.Error(t, err)
2017-07-19 00:37:28 +02:00
_, err = NewEngine().ParseAndRenderString("{% undefined_tag %}", emptyBindings)
2017-07-15 19:29:53 +02:00
require.Error(t, err)
2017-07-19 00:37:28 +02:00
_, err = NewEngine().ParseAndRenderString("{% a | undefined_filter %}", emptyBindings)
2017-07-15 19:29:53 +02:00
require.Error(t, err)
2017-07-05 20:24:15 +02:00
}