|
|
@ -59,3 +59,25 @@ func TestCreateAndFind(t *testing.T) { |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func TestEmptyRoot(t *testing.T) { |
|
|
|
filer := filer2.NewFiler(nil) |
|
|
|
dir, _ := ioutil.TempDir("", "seaweedfs_filer_test2") |
|
|
|
defer os.RemoveAll(dir) |
|
|
|
store := &LevelDBStore{} |
|
|
|
store.initialize(dir) |
|
|
|
filer.SetStore(store) |
|
|
|
filer.DisableDirectoryCache() |
|
|
|
|
|
|
|
// checking one upper directory
|
|
|
|
entries, err := filer.ListDirectoryEntries(filer2.FullPath("/"), "", false, 100) |
|
|
|
if err != nil { |
|
|
|
t.Errorf("list entries: %v", err) |
|
|
|
return |
|
|
|
} |
|
|
|
if len(entries) != 0 { |
|
|
|
t.Errorf("list entries count: %v", len(entries)) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
} |