mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
test move function
This commit is contained in:
parent
5f975f5ce8
commit
b8bef16c98
|
@ -18,12 +18,19 @@ func TestDirectory(t *testing.T) {
|
||||||
dm.MakeDirectory("/a/b/e")
|
dm.MakeDirectory("/a/b/e")
|
||||||
dm.MakeDirectory("/a/b/e/f")
|
dm.MakeDirectory("/a/b/e/f")
|
||||||
dm.MakeDirectory("/a/b/e/f/g")
|
dm.MakeDirectory("/a/b/e/f/g")
|
||||||
dm.MoveUnderDirectory("/a/b/e/f/g", "/a/b", "")
|
dm.MoveUnderDirectory("/a/b/e/f/g", "/a/b", "t")
|
||||||
if _, err := dm.FindDirectory("/a/b/e/f/g"); err == nil {
|
if _, err := dm.FindDirectory("/a/b/e/f/g"); err == nil {
|
||||||
t.Fatal("/a/b/e/f/g should not exist any more after moving")
|
t.Fatal("/a/b/e/f/g should not exist any more after moving")
|
||||||
}
|
}
|
||||||
if _, err := dm.FindDirectory("/a/b/g"); err != nil {
|
if _, err := dm.FindDirectory("/a/b/t"); err != nil {
|
||||||
t.Fatal("/a/b/g should exist after moving")
|
t.Fatal("/a/b/t should exist after moving")
|
||||||
|
}
|
||||||
|
if _, err := dm.FindDirectory("/a/b/g"); err == nil {
|
||||||
|
t.Fatal("/a/b/g should not exist after moving")
|
||||||
|
}
|
||||||
|
dm.MoveUnderDirectory("/a/b/e/f", "/a/b", "")
|
||||||
|
if _, err := dm.FindDirectory("/a/b/f"); err != nil {
|
||||||
|
t.Fatal("/a/b/g should not exist after moving")
|
||||||
}
|
}
|
||||||
dm.MakeDirectory("/a/b/g/h/i")
|
dm.MakeDirectory("/a/b/g/h/i")
|
||||||
dm.DeleteDirectory("/a/b/e/f")
|
dm.DeleteDirectory("/a/b/e/f")
|
||||||
|
|
Loading…
Reference in a new issue