From 311edcd50f3a84f4b860bde3cb887451d74eaa11 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Wed, 25 Mar 2026 16:22:03 +0000 Subject: network/protocol: Rename from protocol --- .../sideband64k/decoder_invalid_band_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 network/protocol/sideband64k/decoder_invalid_band_test.go (limited to 'network/protocol/sideband64k/decoder_invalid_band_test.go') diff --git a/network/protocol/sideband64k/decoder_invalid_band_test.go b/network/protocol/sideband64k/decoder_invalid_band_test.go new file mode 100644 index 00000000..a4bc11a9 --- /dev/null +++ b/network/protocol/sideband64k/decoder_invalid_band_test.go @@ -0,0 +1,20 @@ +package sideband64k_test + +import ( + "errors" + "strings" + "testing" + + "codeberg.org/lindenii/furgit/network/protocol/sideband64k" +) + +func TestDecoderInvalidBand(t *testing.T) { + t.Parallel() + + dec := sideband64k.NewDecoder(strings.NewReader("0005\x04"), sideband64k.ReadOptions{}) + _, err := dec.ReadFrame() + + if _, ok := errors.AsType[*sideband64k.ProtocolError](err); !ok { + t.Fatalf("got err %v, want ProtocolError", err) + } +} -- cgit v1.3.1-10-gc9f91