From b8bef16c9831c451bed7454f3f965e080688c729 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 20 Jul 2014 23:48:48 -0700 Subject: [PATCH] test move function --- go/filer/directory_test.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/go/filer/directory_test.go b/go/filer/directory_test.go index 33a6b4c77..ea4903f03 100644 --- a/go/filer/directory_test.go +++ b/go/filer/directory_test.go @@ -18,12 +18,19 @@ func TestDirectory(t *testing.T) { dm.MakeDirectory("/a/b/e") dm.MakeDirectory("/a/b/e/f") 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 { t.Fatal("/a/b/e/f/g should not exist any more after moving") } - if _, err := dm.FindDirectory("/a/b/g"); err != nil { - t.Fatal("/a/b/g should exist after moving") + if _, err := dm.FindDirectory("/a/b/t"); err != nil { + 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.DeleteDirectory("/a/b/e/f")