MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / TestWriteReadHeader

Function TestWriteReadHeader

cache/filesystem_cache_test.go:27–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestWriteReadHeader(t *testing.T) {
28 expectedS := "foo-bar1; baz"
29 bb := &bytes.Buffer{}
30 if err := writeHeader(bb, expectedS); err != nil {
31 t.Fatalf("cannot write header: %q", err)
32 }
33
34 s, err := readHeader(bb)
35 if err != nil {
36 t.Fatalf("cannot read header: %q", err)
37 }
38 if s != expectedS {
39 t.Fatalf("unexpected header %q; expecting %q", s, expectedS)
40 }
41}
42
43func TestCacheClose(t *testing.T) {
44 for i := 0; i < 10; i++ {

Callers

nothing calls this directly

Calls 2

writeHeaderFunction · 0.85
readHeaderFunction · 0.85

Tested by

no test coverage detected