1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-27 02:44:38 +01:00
liquid/liquid_test.go

19 lines
594 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)
require.True(t, IsTemplateError(err))
_, err = NewEngine().ParseAndRenderString("{% if %}", emptyBindings)
require.True(t, IsTemplateError(err))
_, err = NewEngine().ParseAndRenderString("{% unknown_tag %}", emptyBindings)
require.True(t, IsTemplateError(err))
_, err = NewEngine().ParseAndRenderString("{% a | unknown_filter %}", emptyBindings)
require.True(t, IsTemplateError(err))
}