diff --git a/peer_protocol/decoder_fuzz_test.go b/peer_protocol/fuzz_test.go similarity index 75% rename from peer_protocol/decoder_fuzz_test.go rename to peer_protocol/fuzz_test.go index 2fd357e4..2c92c70c 100644 --- a/peer_protocol/decoder_fuzz_test.go +++ b/peer_protocol/fuzz_test.go @@ -1,3 +1,5 @@ +//go:build go1.18 + package peer_protocol import ( @@ -43,3 +45,14 @@ func FuzzDecoder(f *testing.F) { c.Assert(buf.Bytes(), qt.DeepEquals, b) }) } + +func FuzzMessageMarshalBinary(f *testing.F) { + f.Fuzz(func(t *testing.T, b []byte) { + var m Message + if err := m.UnmarshalBinary(b); err != nil { + t.Skip(err) + } + b0 := m.MustMarshalBinary() + qt.Assert(t, b0, qt.DeepEquals, b) + }) +} diff --git a/peer_protocol/msg_fuzz_test.go b/peer_protocol/msg_fuzz_test.go deleted file mode 100644 index 9e214b30..00000000 --- a/peer_protocol/msg_fuzz_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package peer_protocol - -import ( - "testing" - - qt "github.com/frankban/quicktest" -) - -func FuzzMessageMarshalBinary(f *testing.F) { - f.Fuzz(func(t *testing.T, b []byte) { - var m Message - if err := m.UnmarshalBinary(b); err != nil { - t.Skip(err) - } - b0 := m.MustMarshalBinary() - qt.Assert(t, b0, qt.DeepEquals, b) - }) -}