MCPcopy
hub / github.com/expr-lang/expr / TestCompile_exposed_error_with_multiline_script

Function TestCompile_exposed_error_with_multiline_script

expr_test.go:1794–1803  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1792}
1793
1794func TestCompile_exposed_error_with_multiline_script(t *testing.T) {
1795 _, err := expr.Compile("{\n\ta: 1,\n\tb: #,\n\tc: 3,\n}")
1796 require.Error(t, err)
1797
1798 fileError, ok := err.(*file.Error)
1799 require.True(t, ok, "error should be of type *file.Error")
1800 require.Equal(t, "unexpected token Operator(\"#\") (3:5)\n | b: #,\n | ....^", fileError.Error())
1801 require.Equal(t, 4, fileError.Column)
1802 require.Equal(t, 3, fileError.Line)
1803}
1804
1805func TestIssue105(t *testing.T) {
1806 type A struct {

Callers

nothing calls this directly

Calls 5

CompileFunction · 0.92
ErrorFunction · 0.92
TrueFunction · 0.92
EqualFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…