aboutsummaryrefslogtreecommitdiff
path: root/network/protocol/pktline/append_helpers_test.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-25 16:22:03 +0000
committerGravatar Runxi Yu2026-03-25 16:22:03 +0000
commit311edcd50f3a84f4b860bde3cb887451d74eaa11 (patch)
treebe7aa5e9a51e636358f33b1c90637b5024b70dc3 /network/protocol/pktline/append_helpers_test.go
parentREADME: Split off contrib, benchmarks, remove history for now I guess, etc. (diff)
signatureNo signature
network/protocol: Rename from protocol v0.1.110
Diffstat (limited to 'network/protocol/pktline/append_helpers_test.go')
-rw-r--r--network/protocol/pktline/append_helpers_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/network/protocol/pktline/append_helpers_test.go b/network/protocol/pktline/append_helpers_test.go
new file mode 100644
index 00000000..259ada16
--- /dev/null
+++ b/network/protocol/pktline/append_helpers_test.go
@@ -0,0 +1,24 @@
+package pktline_test
+
+import (
+ "testing"
+
+ "codeberg.org/lindenii/furgit/network/protocol/pktline"
+)
+
+func TestAppendHelpers(t *testing.T) {
+ t.Parallel()
+
+ out, err := pktline.AppendData(nil, []byte("ok"))
+ if err != nil {
+ t.Fatalf("AppendData: %v", err)
+ }
+
+ out = pktline.AppendFlushPkt(out)
+ out = pktline.AppendDelimPkt(out)
+ out = pktline.AppendResponseEndPkt(out)
+
+ if got, want := string(out), "0006ok000000010002"; got != want {
+ t.Fatalf("got %q, want %q", got, want)
+ }
+}