File: fuzz.go

package info (click to toggle)
golang-github-andybalholm-cascadia 0.0~git20161224.0.349dd02-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 376 kB
  • ctags: 89
  • sloc: makefile: 2
file content (15 lines) | stat: -rw-r--r-- 282 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package fuzz

import "github.com/andybalholm/cascadia"

// Fuzz is the entrypoint used by the go-fuzz framework
func Fuzz(data []byte) int {
	sel, err := cascadia.Compile(string(data))
	if err != nil {
		if sel != nil {
			panic("sel != nil on error")
		}
		return 0
	}
	return 1
}