aboutsummaryrefslogtreecommitdiff
path: root/network/protocol/v0v1/server/receivepack/helpers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'network/protocol/v0v1/server/receivepack/helpers_test.go')
-rw-r--r--network/protocol/v0v1/server/receivepack/helpers_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/network/protocol/v0v1/server/receivepack/helpers_test.go b/network/protocol/v0v1/server/receivepack/helpers_test.go
new file mode 100644
index 00000000..5db8e6a6
--- /dev/null
+++ b/network/protocol/v0v1/server/receivepack/helpers_test.go
@@ -0,0 +1,28 @@
+package receivepack_test
+
+import (
+ "bytes"
+ "strings"
+ "testing"
+
+ objectid "codeberg.org/lindenii/furgit/object/id"
+)
+
+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
+}