diff options
Diffstat (limited to 'network/protocol/pktline/append_helpers_test.go')
| -rw-r--r-- | network/protocol/pktline/append_helpers_test.go | 24 |
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) + } +} |
