diff --git a/bencode/fuzz_test.go b/bencode/fuzz_test.go index 57c18eed..35b841d2 100644 --- a/bencode/fuzz_test.go +++ b/bencode/fuzz_test.go @@ -3,11 +3,17 @@ package bencode import ( + "math/big" "testing" qt "github.com/frankban/quicktest" + "github.com/google/go-cmp/cmp" ) +var bencodeInterfaceChecker = qt.CmpEquals(cmp.Comparer(func(a, b *big.Int) bool { + return a.Cmp(b) == 0 +})) + func Fuzz(f *testing.F) { f.Fuzz(func(t *testing.T, b []byte) { c := qt.New(t) @@ -21,6 +27,6 @@ func Fuzz(f *testing.F) { var d0 interface{} err = Unmarshal(b0, &d0) c.Assert(err, qt.IsNil) - c.Assert(d0, qt.DeepEquals, d) + c.Assert(d0, bencodeInterfaceChecker, d) }) } diff --git a/bencode/testdata/fuzz/Fuzz/65cfcaf31066e15825ace0f8e03701b8729a159063a9ca0884df18a5c9499715 b/bencode/testdata/fuzz/Fuzz/65cfcaf31066e15825ace0f8e03701b8729a159063a9ca0884df18a5c9499715 new file mode 100644 index 00000000..127ed5fd --- /dev/null +++ b/bencode/testdata/fuzz/Fuzz/65cfcaf31066e15825ace0f8e03701b8729a159063a9ca0884df18a5c9499715 @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("i62208002200000000:00{݃y\u007f m.\x16\t\fZL\x18'\xad\xe7\xc4e")