Commit 7fb4f4d3 authored by Aaron Jacobs's avatar Aaron Jacobs

MemFSTest.RenameOverExisting_WrongType

parent a28c3afd
......@@ -1623,7 +1623,23 @@ func (t *MemFSTest) RenameOverExistingDirectory() {
}
func (t *MemFSTest) RenameOverExisting_WrongType() {
AssertTrue(false, "TODO")
var err error
// Create a file and a directory.
filePath := path.Join(t.Dir, "foo")
err = ioutil.WriteFile(filePath, []byte("taco"), 0400)
AssertEq(nil, err)
dirPath := path.Join(t.Dir, "bar")
err = os.Mkdir(dirPath, 0700)
AssertEq(nil, err)
// Renaming one over the other shouldn't work.
err = os.Rename(filePath, dirPath)
ExpectThat(err, Error(HasSubstr("is a directory")))
err = os.Rename(dirPath, filePath)
ExpectThat(err, Error(HasSubstr("not a directory")))
}
func (t *MemFSTest) RenameNonExistentFile() {
......
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