From 4b8d39764f9b54ea3090d0fea92a23025dbea30d Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 7 Mar 2026 14:24:05 +0800 Subject: protocol: Add v0v1 server protocol and its receivepack subprotocol --- protocol/v0v1/server/helpers_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 protocol/v0v1/server/helpers_test.go (limited to 'protocol/v0v1/server/helpers_test.go') diff --git a/protocol/v0v1/server/helpers_test.go b/protocol/v0v1/server/helpers_test.go new file mode 100644 index 00000000..ff2a69f3 --- /dev/null +++ b/protocol/v0v1/server/helpers_test.go @@ -0,0 +1,28 @@ +package server_test + +import ( + "bytes" + "strings" + "testing" + + "codeberg.org/lindenii/furgit/objectid" +) + +type bufferWriteFlusher struct { + bytes.Buffer +} + +func (bufferWriteFlusher) Flush() error { + return nil +} + +func mustHexID(tb testing.TB, algo objectid.Algorithm, digit string) objectid.ObjectID { + tb.Helper() + + id, err := objectid.ParseHex(algo, strings.Repeat(digit, algo.HexLen())) + if err != nil { + tb.Fatalf("objectid.ParseHex(%q): %v", strings.Repeat(digit, algo.HexLen()), err) + } + + return id +} -- cgit v1.3.1-10-gc9f91