diff options
| author | 2026-03-25 16:22:03 +0000 | |
|---|---|---|
| committer | 2026-03-25 16:22:03 +0000 | |
| commit | 311edcd50f3a84f4b860bde3cb887451d74eaa11 (patch) | |
| tree | be7aa5e9a51e636358f33b1c90637b5024b70dc3 /protocol/pktline/decoder_resync_after_over_wire_max_test.go | |
| parent | README: Split off contrib, benchmarks, remove history for now I guess, etc. (diff) | |
| signature | No signature | |
network/protocol: Rename from protocol v0.1.110
Diffstat (limited to 'protocol/pktline/decoder_resync_after_over_wire_max_test.go')
| -rw-r--r-- | protocol/pktline/decoder_resync_after_over_wire_max_test.go | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/protocol/pktline/decoder_resync_after_over_wire_max_test.go b/protocol/pktline/decoder_resync_after_over_wire_max_test.go deleted file mode 100644 index 3ba98d62..00000000 --- a/protocol/pktline/decoder_resync_after_over_wire_max_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package pktline_test - -import ( - "bytes" - "errors" - "testing" - - "codeberg.org/lindenii/furgit/protocol/pktline" -) - -func TestDecoderResyncAfterOverWireMax(t *testing.T) { - t.Parallel() - - var b bytes.Buffer - - _, _ = b.WriteString("ffff") - _, _ = b.Write(bytes.Repeat([]byte{'a'}, 65531)) - _, _ = b.WriteString("0005z") - - dec := pktline.NewDecoder(bytes.NewReader(b.Bytes()), pktline.ReadOptions{}) - dec.SetMaxData(70000) - - _, err := dec.ReadFrame() - - if _, ok := errors.AsType[*pktline.ProtocolError](err); !ok { - t.Fatalf("got err %v, want ProtocolError", err) - } - - f, err := dec.ReadFrame() - if err != nil { - t.Fatalf("ReadFrame #2: %v", err) - } - - if f.Type != pktline.PacketData || string(f.Payload) != "z" { - t.Fatalf("got frame %#v, want data z", f) - } -} |
