MCPcopy Create free account
hub / github.com/cel-expr/cel-go / FuzzCompile

Function FuzzCompile

fuzzing/fuzz_compile_test.go:21–35  ·  view source on GitHub ↗
(f *testing.F)

Source from the content-addressed store, hash-verified

19)
20
21func 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

Callers

nothing calls this directly

Calls 5

getCELFuzzEnvFunction · 0.85
ErrMethod · 0.80
ProgramMethod · 0.80
AddMethod · 0.65
CompileMethod · 0.65

Tested by

no test coverage detected