forked from mirror/afero
Make MemMapFs.Remove() error for non-existent file
So that it's consistent with the os package.
This commit is contained in:
parent
a269144fd6
commit
6ced24dbe1
10
fs_test.go
10
fs_test.go
|
@ -122,12 +122,20 @@ func TestRemove(t *testing.T) {
|
|||
|
||||
err := fs.Remove(path)
|
||||
if err != nil {
|
||||
t.Fatalf("%v: Remove() failed: %v", fs.Name(), err)
|
||||
t.Errorf("%v: Remove() failed: %v", fs.Name(), err)
|
||||
continue
|
||||
}
|
||||
|
||||
_, err = fs.Stat(path)
|
||||
if !os.IsNotExist(err) {
|
||||
t.Errorf("%v: Remove() didn't remove file", fs.Name())
|
||||
continue
|
||||
}
|
||||
|
||||
// Deleting non-existent file should raise error
|
||||
err = fs.Remove(path)
|
||||
if !os.IsNotExist(err) {
|
||||
t.Errorf("%v: Remove() didn't raise error for non-existent file", fs.Name())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue