Commit 45ab9845 authored by Aaron Jacobs's avatar Aaron Jacobs

Improved rename tests.

parent 3440c23d
......@@ -1327,10 +1327,10 @@ func (t *MemFSTest) RenameWithinDir_Directory() {
err = os.Mkdir(parentPath, 0700)
AssertEq(nil, err)
// And a directory within it.
// And a non-empty directory within it.
oldPath := path.Join(parentPath, "foo")
err = os.Mkdir(oldPath, 0700)
err = os.MkdirAll(path.Join(oldPath, "child"), 0700)
AssertEq(nil, err)
// Rename it.
......@@ -1349,7 +1349,7 @@ func (t *MemFSTest) RenameWithinDir_Directory() {
ExpectEq(len("taco"), fi.Size())
ExpectTrue(fi.IsDir())
// There should only be the new entry in the directory.
// There should only be the new entry in the parent.
entries, err := fusetesting.ReadDirPicky(parentPath)
AssertEq(nil, err)
AssertEq(1, len(entries))
......@@ -1357,6 +1357,15 @@ func (t *MemFSTest) RenameWithinDir_Directory() {
ExpectEq(path.Base(newPath), fi.Name())
ExpectTrue(fi.IsDir())
// And the child should still be present.
entries, err = fusetesting.ReadDirPicky(newPath)
AssertEq(nil, err)
AssertEq(1, len(entries))
fi = entries[0]
ExpectEq("child", fi.Name())
ExpectTrue(fi.IsDir())
}
func (t *MemFSTest) RenameAcrossDirs_File() {
......@@ -1366,3 +1375,19 @@ func (t *MemFSTest) RenameAcrossDirs_File() {
func (t *MemFSTest) RenameAcrossDirs_Directory() {
AssertTrue(false, "TODO")
}
func (t *MemFSTest) RenameOutOfFileSystem_File() {
AssertTrue(false, "TODO")
}
func (t *MemFSTest) RenameOutOfFileSystem_Directory() {
AssertTrue(false, "TODO")
}
func (t *MemFSTest) RenameIntoFileSystem_File() {
AssertTrue(false, "TODO")
}
func (t *MemFSTest) RenameIntoFileSystem_Directory() {
AssertTrue(false, "TODO")
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment