MCPcopy
hub / github.com/cayleygraph/cayley / TestDecompressor

Function TestDecompressor

internal/decompressor/decompressor_test.go:78–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestDecompressor(t *testing.T) {
79 for _, test := range testDecompressor {
80 r, err := New(test.input)
81 if err != test.err {
82 t.Fatalf("Unexpected error for %s, got:%v expect:%v", test.message, err, test.err)
83 }
84 if err != nil {
85 continue
86 }
87 p := make([]byte, len(test.expect)*2)
88 n, err := r.Read(p)
89 if err != test.readErr && err != io.EOF {
90 t.Fatalf("Unexpected error for reading %s, got:%v expect:%v", test.message, err, test.err)
91 }
92 if bytes.Compare(p[:n], test.expect) != 0 {
93 t.Errorf("Unexpected read result for %s, got:%q expect:%q", test.message, p[:n], test.expect)
94 }
95 }
96}

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected