MCPcopy
hub / github.com/perkeep/perkeep / TestRoot

Function TestRoot

pkg/fs/fs_test.go:166–184  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

164}
165
166func TestRoot(t *testing.T) {
167 condSkip(t)
168 pkmountTest(t, func(env *mountEnv) {
169 f, err := os.Open(env.mountPoint)
170 if err != nil {
171 t.Fatal(err)
172 }
173 defer f.Close()
174 names, err := f.Readdirnames(-1)
175 if err != nil {
176 t.Fatal(err)
177 }
178 sort.Strings(names)
179 want := []string{"WELCOME.txt", "at", "date", "recent", "roots", "sha1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "sha224-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "tag", "versions"}
180 if !reflect.DeepEqual(names, want) {
181 t.Errorf("root directory = %q; want %q", names, want)
182 }
183 })
184}
185
186func TestReadFileFromRoot(t *testing.T) {
187 condSkip(t)

Callers

nothing calls this directly

Calls 5

condSkipFunction · 0.85
pkmountTestFunction · 0.85
FatalMethod · 0.80
OpenMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected