Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Commit 6fc2fdc

Browse files
author
Yevgeny Pats
committed
add generational fuzzing example
1 parent 5be6d81 commit 6fc2fdc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

parse_complex_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
package parser
22

3-
import "testing"
3+
// This is just an example of a generational fuzzer which benchmarks the resutls against a coverage guided fuzzer
4+
// This won't find the results for never probabbly ...
5+
6+
import (
7+
"github.com/google/gofuzz"
8+
"testing"
9+
)
410

511
func TestParseComplex(t *testing.T) {
6-
res := ParseComplex([]byte("Incorrect Data"))
7-
if res {
8-
t.Fail()
12+
f := fuzz.New()
13+
var inputString string
14+
for true {
15+
f.Fuzz(&inputString)
16+
ParseComplex([]byte(inputString))
917
}
1018
}

0 commit comments

Comments
 (0)