fuzz.go 282 B

123456789101112131415
  1. package fuzz
  2. import "github.com/andybalholm/cascadia"
  3. // Fuzz is the entrypoint used by the go-fuzz framework
  4. func Fuzz(data []byte) int {
  5. sel, err := cascadia.Compile(string(data))
  6. if err != nil {
  7. if sel != nil {
  8. panic("sel != nil on error")
  9. }
  10. return 0
  11. }
  12. return 1
  13. }