We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56d0528 commit eecf371Copy full SHA for eecf371
expr_test.go
@@ -2845,3 +2845,20 @@ func TestMemoryBudget(t *testing.T) {
2845
})
2846
}
2847
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