super-graph/core/internal/qcode/fuzz.go

21 lines
299 B
Go
Raw Permalink Normal View History

// +build gofuzz
2019-04-19 03:08:14 +02:00
package qcode
// FuzzerEntrypoint for Fuzzbuzz
2019-10-26 09:02:05 +02:00
func Fuzz(data []byte) int {
2020-02-02 07:43:09 +01:00
qt := GetQType(string(data))
if qt > QTUpsert {
panic("qt > QTUpsert")
}
2019-11-25 08:22:33 +01:00
2019-04-19 03:08:14 +02:00
qcompile, _ := NewCompiler(Config{})
2019-10-14 08:51:36 +02:00
_, err := qcompile.Compile(data, "user")
2019-04-19 03:08:14 +02:00
if err != nil {
2019-10-26 09:02:05 +02:00
return 0
2019-04-19 03:08:14 +02:00
}
2019-10-26 09:02:05 +02:00
return 1
2019-04-19 03:08:14 +02:00
}