go test -v -run=^$ -fuzz=FuzzUtilsGetOffer
(f *testing.F)
| 8 | |
| 9 | // go test -v -run=^$ -fuzz=FuzzUtilsGetOffer |
| 10 | func FuzzUtilsGetOffer(f *testing.F) { |
| 11 | inputs := []string{ |
| 12 | `application/json; v=1; foo=bar; q=0.938; extra=param, text/plain;param="big fox"; q=0.43`, |
| 13 | `text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8`, |
| 14 | `*/*`, |
| 15 | `text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c`, |
| 16 | } |
| 17 | for _, input := range inputs { |
| 18 | f.Add(input) |
| 19 | } |
| 20 | f.Fuzz(func(_ *testing.T, spec string) { |
| 21 | getOffer([]byte(spec), acceptsOfferType, `application/json;version=1;v=1;foo=bar`, `text/plain;param="big fox"`) |
| 22 | }) |
| 23 | } |