diff options
Diffstat (limited to 'network/protocol/sideband64k/decoder_unexpected_eof_test.go')
| -rw-r--r-- | network/protocol/sideband64k/decoder_unexpected_eof_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/network/protocol/sideband64k/decoder_unexpected_eof_test.go b/network/protocol/sideband64k/decoder_unexpected_eof_test.go new file mode 100644 index 00000000..d9d71fb9 --- /dev/null +++ b/network/protocol/sideband64k/decoder_unexpected_eof_test.go @@ -0,0 +1,21 @@ +package sideband64k_test + +import ( + "errors" + "io" + "strings" + "testing" + + "codeberg.org/lindenii/furgit/network/protocol/sideband64k" +) + +func TestDecoderUnexpectedEOF(t *testing.T) { + t.Parallel() + + dec := sideband64k.NewDecoder(strings.NewReader("0006\x01"), sideband64k.ReadOptions{}) + + _, err := dec.ReadFrame() + if !errors.Is(err, io.ErrUnexpectedEOF) { + t.Fatalf("got err %v, want io.ErrUnexpectedEOF", err) + } +} |
