// +build gofuzz package fuzz import "github.com/tdewolff/parse/v2" // Fuzz is a fuzz test. func Fuzz(data []byte) int { data = parse.Copy(data) // ignore const-input error for OSS-Fuzz newData := parse.ReplaceEntities(data, map[string][]byte{ "test": []byte("&t;"), "test3": []byte("&test;"), "test5": []byte(""), "quot": []byte("\""), "apos": []byte("'"), }, map[byte][]byte{ '\'': []byte("""), '"': []byte("'"), }) if len(newData) > len(data) { panic("output longer than input") } return 1 }