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

Function TestIssue_integer_truncated_by_compiler

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

Source from the content-addressed store, hash-verified

2692}
2693
2694func TestIssue_integer_truncated_by_compiler(t *testing.T) {
2695 env := map[string]any{
2696 "fn": func(x byte) byte {
2697 return x
2698 },
2699 }
2700
2701 _, err := expr.Compile("fn(255)", expr.Env(env))
2702 require.NoError(t, err)
2703
2704 _, err = expr.Compile("fn(256)", expr.Env(env))
2705 require.Error(t, err)
2706}
2707
2708func TestExpr_crash(t *testing.T) {
2709 content, err := os.ReadFile("testdata/crash.txt")

Callers

nothing calls this directly

Calls 4

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
ErrorFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…