mirror of
https://github.com/danog/liquid.git
synced 2024-11-27 06:44:42 +01:00
19 lines
534 B
Go
19 lines
534 B
Go
package liquid
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIsTemplateError(t *testing.T) {
|
|
_, err := NewEngine().ParseAndRenderString("{{ syntax error }}", emptyBindings)
|
|
require.Error(t, err)
|
|
_, err = NewEngine().ParseAndRenderString("{% if %}", emptyBindings)
|
|
require.Error(t, err)
|
|
_, err = NewEngine().ParseAndRenderString("{% undefined_tag %}", emptyBindings)
|
|
require.Error(t, err)
|
|
_, err = NewEngine().ParseAndRenderString("{% a | undefined_filter %}", emptyBindings)
|
|
require.Error(t, err)
|
|
}
|