MCPcopy
hub / github.com/perkeep/perkeep / TestPaths

Function TestPaths

pkg/blobserver/files/path_test.go:26–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func TestPaths(t *testing.T) {
27 br := blob.MustParse("digalg-abc")
28 ds := &Storage{root: "/tmp/dir"}
29
30 slash := filepath.ToSlash
31 if e, g := "/tmp/dir/digalg/ab/c_", slash(ds.blobDirectory(br)); e != g {
32 t.Errorf("short blobref dir; expected path %q; got %q", e, g)
33 }
34 if e, g := "/tmp/dir/digalg/ab/c_/digalg-abc.dat", slash(ds.blobPath(br)); e != g {
35 t.Errorf("short blobref path; expected path %q; got %q", e, g)
36 }
37}

Callers

nothing calls this directly

Calls 3

blobDirectoryMethod · 0.95
blobPathMethod · 0.95
MustParseFunction · 0.92

Tested by

no test coverage detected