aboutsummaryrefslogtreecommitdiff
path: root/protocol/sideband64k/decoder_unexpected_eof_test.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-10 13:28:59 +0800
committerGravatar Runxi Yu2026-03-10 13:28:59 +0800
commitaf08c84539f9353718604988ba27ae3c466860fc (patch)
tree0f1f2536f57af69b55ae06e78efbe26a7a0b3633 /protocol/sideband64k/decoder_unexpected_eof_test.go
parentforgejo, github: Update issue templates (diff)
signatureNo signature
*: Move sideband64k and pktline to protocol/
Diffstat (limited to 'protocol/sideband64k/decoder_unexpected_eof_test.go')
-rw-r--r--protocol/sideband64k/decoder_unexpected_eof_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/protocol/sideband64k/decoder_unexpected_eof_test.go b/protocol/sideband64k/decoder_unexpected_eof_test.go
new file mode 100644
index 00000000..74d5a6fb
--- /dev/null
+++ b/protocol/sideband64k/decoder_unexpected_eof_test.go
@@ -0,0 +1,21 @@
+package sideband64k_test
+
+import (
+ "errors"
+ "io"
+ "strings"
+ "testing"
+
+ "codeberg.org/lindenii/furgit/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)
+ }
+}