aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/inode_to_path_test.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-23 18:20:29 -0700
committerchrislu <chris.lu@gmail.com>2022-07-23 18:20:29 -0700
commitd24db396cc845518dbc5fad32011e5d174354b62 (patch)
treeafe893b1bf0529ace5272a8d5cd9ceaa10dfe00b /weed/mount/inode_to_path_test.go
parent41eeb4deef02eb7981e01dcba9b6e8469d7fed38 (diff)
downloadseaweedfs-d24db396cc845518dbc5fad32011e5d174354b62.tar.xz
seaweedfs-d24db396cc845518dbc5fad32011e5d174354b62.zip
fix removing path from inode2path
Diffstat (limited to 'weed/mount/inode_to_path_test.go')
-rw-r--r--weed/mount/inode_to_path_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/weed/mount/inode_to_path_test.go b/weed/mount/inode_to_path_test.go
index b9723c4c5..0e7af21ee 100644
--- a/weed/mount/inode_to_path_test.go
+++ b/weed/mount/inode_to_path_test.go
@@ -14,6 +14,15 @@ func TestInodeEntry_removeOnePath(t *testing.T) {
count int
}{
{
+ name: "actual case",
+ entry: InodeEntry{
+ paths: []util.FullPath{"/pjd/nx", "/pjd/n0"},
+ },
+ p: "/pjd/nx",
+ want: true,
+ count: 1,
+ },
+ {
name: "empty",
entry: InodeEntry{},
p: "x",
@@ -74,6 +83,11 @@ func TestInodeEntry_removeOnePath(t *testing.T) {
if tt.count != len(tt.entry.paths) {
t.Errorf("removeOnePath path count = %v, want %v", len(tt.entry.paths), tt.count)
}
+ for i, p := range tt.entry.paths {
+ if p == tt.p {
+ t.Errorf("removeOnePath found path still exists at %v, %v", i, p)
+ }
+ }
})
}
}