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

Function TestIssue807

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

Source from the content-addressed store, hash-verified

2908}
2909
2910func TestIssue807(t *testing.T) {
2911 type MyStruct struct {
2912 nonExported string
2913 }
2914 out, err := expr.Eval(` "nonExported" in $env `, MyStruct{})
2915 if err != nil {
2916 t.Fatalf("unexpected error: %v", err)
2917 }
2918 b, ok := out.(bool)
2919 if !ok {
2920 t.Fatalf("expected boolean type, got %T: %v", b, b)
2921 }
2922 if b {
2923 t.Fatalf("expected 'in' operator to return false for unexported field")
2924 }
2925}
2926
2927func TestDisableShortCircuit(t *testing.T) {
2928 count := 0

Callers

nothing calls this directly

Calls 1

EvalFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…