(f *testing.F)
| 19 | ) |
| 20 | |
| 21 | func FuzzCompile(f *testing.F) { |
| 22 | f.Add([]byte("1 + 2 == 3")) |
| 23 | f.Add([]byte("'hello'.startsWith('h') && [1, 2, 3].exists(x, x > 2)")) |
| 24 | f.Fuzz(func(t *testing.T, data []byte) { |
| 25 | env, err := getCELFuzzEnv() |
| 26 | if err != nil { |
| 27 | panic("impossible to create env") |
| 28 | } |
| 29 | ast, issues := env.Compile(string(data)) |
| 30 | if issues != nil && issues.Err() != nil { |
| 31 | return |
| 32 | } |
| 33 | _, _ = env.Program(ast) |
| 34 | }) |
| 35 | } |
| 36 |
nothing calls this directly
no test coverage detected