1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 10:48:59 +01:00
liquid/expressions/parser_test.go
Oliver Steele caca7a2b60 Coverage
2017-07-02 07:51:24 -04:00

24 lines
507 B
Go

package expressions
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
var parseErrorTests = []struct{ in, expected string }{
{"a syntax error", "parse error"},
}
func TestExpressionParseErrors(t *testing.T) {
for i, test := range parseErrorTests {
t.Run(fmt.Sprintf("%02d", i+1), func(t *testing.T) {
expr, err := Parse(test.in)
require.Nilf(t, expr, test.in)
require.Errorf(t, err, test.in, test.in)
require.Containsf(t, err.Error(), test.expected, test.in)
})
}
}