MCPcopy Create free account
hub / github.com/bobg/hashsplit / TestSplitFew

Function TestSplitFew

hashsplit_test.go:41–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestSplitFew(t *testing.T) {
42 for num := 0; num < 2; num++ {
43 var (
44 inp = make([]byte, num)
45 got []byte
46 )
47
48 split, errptr := Split(bytes.NewReader(inp))
49 for chunk := range split {
50 got = append(got, chunk...)
51 }
52 if err := *errptr; err != nil {
53 t.Fatal(err)
54 }
55 if len(got) != num {
56 t.Errorf("got %d byte(s), want %d", len(got), num)
57 }
58 }
59}
60
61func TestTree(t *testing.T) {
62 text, err := os.ReadFile("testdata/commonsense.txt")

Callers

nothing calls this directly

Calls 1

SplitFunction · 0.85

Tested by

no test coverage detected