aboutsummaryrefslogtreecommitdiff
path: root/protocol/v0v1/server/helpers_test.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-07 14:24:05 +0800
committerGravatar Runxi Yu2026-03-07 17:01:46 +0800
commit4b8d39764f9b54ea3090d0fea92a23025dbea30d (patch)
treecaa6e408c4ea625afcbb1b4aa4fb9e945f46994b /protocol/v0v1/server/helpers_test.go
parentrefstore: Split files (diff)
signatureNo signature
protocol: Add v0v1 server protocol and its receivepack subprotocol
Diffstat (limited to 'protocol/v0v1/server/helpers_test.go')
-rw-r--r--protocol/v0v1/server/helpers_test.go28
1 files changed, 28 insertions, 0 deletions
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
+}