@@ -42,7 +42,7 @@ func FuzzExpr(f *testing.F) {
42
42
`i <= j` ,
43
43
`i in a` ,
44
44
`i not in a` ,
45
- `i in m` ,
45
+ `s in m` ,
46
46
`m.a` ,
47
47
`m.m.a` ,
48
48
`a[0]` ,
@@ -59,7 +59,7 @@ func FuzzExpr(f *testing.F) {
59
59
`string(i)` ,
60
60
`trim(" a ")` ,
61
61
`trim("_a_", "_")` ,
62
- `trimPrefix(" a")` ,
62
+ `trimPrefix(" a", " " )` ,
63
63
`trimSuffix("a ")` ,
64
64
`upper("a")` ,
65
65
`lower("A")` ,
@@ -116,6 +116,9 @@ func FuzzExpr(f *testing.F) {
116
116
regexp .MustCompile (`reflect: call of reflect.Value.Call on .* Value` ),
117
117
regexp .MustCompile (`reflect: call of reflect.Value.Index on map Value` ),
118
118
regexp .MustCompile (`reflect: call of reflect.Value.Len on .* Value` ),
119
+ regexp .MustCompile (`strings: negative Repeat count` ),
120
+ regexp .MustCompile (`strings: illegal bytes to escape` ),
121
+ regexp .MustCompile (`operator "in" not defined on int` ),
119
122
}
120
123
121
124
skipCode := []string {
@@ -125,25 +128,25 @@ func FuzzExpr(f *testing.F) {
125
128
f .Fuzz (func (t * testing.T , code string ) {
126
129
for _ , skipCase := range skipCode {
127
130
if strings .Contains (code , skipCase ) {
128
- t .Skip ( )
131
+ t .Skipf ( "skip code: %s" , skipCase )
129
132
return
130
133
}
131
134
}
132
135
133
- program , err := expr .Compile (code , expr .Env (env ), fn )
136
+ program , err := expr .Compile (code , expr .Env (env ), fn , expr . ExperimentalPipes () )
134
137
if err != nil {
135
- t .Skip ( )
138
+ t .Skipf ( "compile error: %s" , err )
136
139
}
137
140
138
141
_ , err = expr .Run (program , env )
139
142
if err != nil {
140
143
for _ , okCase := range okCases {
141
144
if okCase .MatchString (err .Error ()) {
142
- t .Skip ( )
145
+ t .Skipf ( "skip error: %s" , err )
143
146
return
144
147
}
145
148
}
146
- t .Errorf ("code: %s, err : %s" , code , err )
149
+ t .Errorf ("code: %s\n err : %s" , code , err )
147
150
}
148
151
})
149
152
}
0 commit comments