Uses random paths with slashes for storagedriver tests, adds edge cases
This replaces only using flat filenames, to better test nested file behaviors. Fixed inmemory/mfs.go and filesystem/driver.go after finding bugs with the new tests and test behavior.
This commit is contained in:
@@ -210,7 +210,7 @@ func (d *dir) move(src, dst string) error {
|
||||
srcDirname, srcFilename := path.Split(src)
|
||||
sp := d.find(srcDirname)
|
||||
|
||||
if sp.path() != srcDirname {
|
||||
if srcDirname != strings.TrimSuffix(sp.path(), "/")+"/" {
|
||||
return errNotExists
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ func (d *dir) delete(p string) error {
|
||||
dirname, filename := path.Split(p)
|
||||
parent := d.find(dirname)
|
||||
|
||||
if dirname != parent.path() {
|
||||
if dirname != strings.TrimSuffix(parent.path(), "/")+"/" {
|
||||
return errNotExists
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user