This commit is contained in:
Chris Lu
2020-08-15 17:01:42 -07:00
parent 0d60e67816
commit a22ee30596
3 changed files with 36 additions and 7 deletions

View File

@@ -94,3 +94,24 @@ func TestFsCacheMove(t *testing.T) {
}
}
func TestFsCacheMove2(t *testing.T) {
cache := newFsCache(nil)
cache.SetFsNode(util.FullPath("/a/b/d"), &File{Name: "dd"})
cache.SetFsNode(util.FullPath("/a/b/e"), &File{Name: "ee"})
cache.Move(util.FullPath("/a/b/d"), util.FullPath("/a/b/e"))
d := cache.GetFsNode(util.FullPath("/a/b/e"))
if d == nil {
t.Errorf("unexpected nil node!")
}
if d.(*File).Name != "e" {
t.Errorf("unexpected node!")
}
}