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
|
|
|
}
|