blob: 2e93bbd5ee8473ad4791b923601abfeabc1cbae4 (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package server_test
import (
"bytes"
"strings"
"testing"
objectid "lindenii.org/go/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
}
|