mirror of
https://github.com/danog/liquid.git
synced 2024-11-30 10:08:58 +01:00
21 lines
624 B
Go
21 lines
624 B
Go
package liquid
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIsTemplateError(t *testing.T) {
|
|
_, err := NewEngine().ParseAndRenderString("{{ syntax error }}", emptyBindings)
|
|
fmt.Printf("%T", err)
|
|
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))
|
|
}
|