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

Function TestIssue138

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

Source from the content-addressed store, hash-verified

1840}
1841
1842func TestIssue138(t *testing.T) {
1843 env := map[string]any{}
1844
1845 _, err := expr.Compile(`1 / (1 - 1)`, expr.Env(env))
1846 require.NoError(t, err)
1847
1848 _, err = expr.Compile(`1 % 0`, expr.Env(env))
1849 require.Error(t, err)
1850 require.Equal(t, "integer divide by zero (1:3)\n | 1 % 0\n | ..^", err.Error())
1851}
1852
1853func TestIssue154(t *testing.T) {
1854 type Data struct {

Callers

nothing calls this directly

Calls 6

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
ErrorFunction · 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…