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 --- .../protocol/sideband64k/append_helpers_test.go | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 network/protocol/sideband64k/append_helpers_test.go (limited to 'network/protocol/sideband64k/append_helpers_test.go') diff --git a/network/protocol/sideband64k/append_helpers_test.go b/network/protocol/sideband64k/append_helpers_test.go new file mode 100644 index 00000000..03196c38 --- /dev/null +++ b/network/protocol/sideband64k/append_helpers_test.go @@ -0,0 +1,30 @@ +package sideband64k_test + +import ( + "testing" + + "codeberg.org/lindenii/furgit/network/protocol/sideband64k" +) + +func TestAppendHelpers(t *testing.T) { + t.Parallel() + + out, err := sideband64k.AppendData(nil, []byte("a")) + if err != nil { + t.Fatalf("AppendData: %v", err) + } + + out, err = sideband64k.AppendProgress(out, []byte("b")) + if err != nil { + t.Fatalf("AppendProgress: %v", err) + } + + out, err = sideband64k.AppendError(out, []byte("c")) + if err != nil { + t.Fatalf("AppendError: %v", err) + } + + if got, want := string(out), "0006\x01a0006\x02b0006\x03c"; got != want { + t.Fatalf("got %q, want %q", got, want) + } +} -- cgit v1.3.1-10-gc9f91