@@ -16,6 +16,7 @@ func FuzzExpr(f *testing.F) {
16
16
"m" : map [string ]interface {}{"a" : 1 , "b" : 2 , "m" : map [string ]int {"a" : 1 }},
17
17
"s" : "abc" ,
18
18
"add" : func (a , b int ) int { return a + b },
19
+ "foo" : Foo {A : 1 , B : 2 , Bar : Bar {A : 1 , B : 2 }},
19
20
}
20
21
21
22
head := expr .Function (
@@ -97,13 +98,16 @@ func FuzzExpr(f *testing.F) {
97
98
`type({a: 1, b: 2})` ,
98
99
`type(head)` ,
99
100
`keys(m)` ,
101
+ `values(m)` ,
102
+ `foo.bar.a` ,
103
+ `foo.bar.b` ,
100
104
}
101
105
102
106
for _ , s := range corpus {
103
107
f .Add (s )
104
108
}
105
109
106
- okCases := []* regexp.Regexp {
110
+ skip := []* regexp.Regexp {
107
111
regexp .MustCompile (`cannot fetch .* from .*` ),
108
112
regexp .MustCompile (`cannot get .* from .*` ),
109
113
regexp .MustCompile (`cannot slice` ),
@@ -139,8 +143,8 @@ func FuzzExpr(f *testing.F) {
139
143
140
144
_ , err = expr .Run (program , env )
141
145
if err != nil {
142
- for _ , okCase := range okCases {
143
- if okCase .MatchString (err .Error ()) {
146
+ for _ , r := range skip {
147
+ if r .MatchString (err .Error ()) {
144
148
t .Skipf ("skip error: %s" , err )
145
149
return
146
150
}
@@ -149,3 +153,14 @@ func FuzzExpr(f *testing.F) {
149
153
}
150
154
})
151
155
}
156
+
157
+ type Foo struct {
158
+ A int `expr:"a"`
159
+ B int `expr:"b"`
160
+ Bar Bar `expr:"bar"`
161
+ }
162
+
163
+ type Bar struct {
164
+ A int `expr:"a"`
165
+ B int `expr:"b"`
166
+ }
0 commit comments