MCPcopy Create free account
hub / github.com/expr-lang/expr / TestIssue802

Function TestIssue802

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

Source from the content-addressed store, hash-verified

2891}
2892
2893func TestIssue802(t *testing.T) {
2894 prog, err := expr.Compile(`arr[1:2][0]`)
2895 if err != nil {
2896 t.Fatalf("error compiling program: %v", err)
2897 }
2898 val, err := expr.Run(prog, map[string]any{
2899 "arr": [5]int{0, 1, 2, 3, 4},
2900 })
2901 if err != nil {
2902 t.Fatalf("error running program: %v", err)
2903 }
2904 valInt, ok := val.(int)
2905 if !ok || valInt != 1 {
2906 t.Fatalf("invalid result, expected 1, got %v", val)
2907 }
2908}
2909
2910func TestIssue807(t *testing.T) {
2911 type MyStruct struct {

Callers

nothing calls this directly

Calls 2

CompileFunction · 0.92
RunFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…