Skip to content

Commit eecf371

Browse files
committed
add regression test for #807
1 parent 56d0528 commit eecf371

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

expr_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,3 +2845,20 @@ func TestMemoryBudget(t *testing.T) {
28452845
})
28462846
}
28472847
}
2848+
2849+
func TestIssue807(t *testing.T) {
2850+
type MyStruct struct {
2851+
nonExported string
2852+
}
2853+
out, err := expr.Eval(` "nonExported" in $env `, MyStruct{})
2854+
if err != nil {
2855+
t.Fatalf("unexpected error: %v", err)
2856+
}
2857+
b, ok := out.(bool)
2858+
if !ok {
2859+
t.Fatalf("expected boolean type, got %T: %v", b, b)
2860+
}
2861+
if b {
2862+
t.Fatalf("expected 'in' operator to return false for unexported field")
2863+
}
2864+
}

0 commit comments

Comments
 (0)