mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-24 15:00:43 +02:00
filepath.Dir of a trailing-slash path returns the mount itself, so a mounted TEST_MOUNT_POINT ending in / was refused.
20 lines
364 B
Go
20 lines
364 B
Go
//go:build unix
|
|
|
|
package fuse
|
|
|
|
import "testing"
|
|
|
|
func TestMountedAt(t *testing.T) {
|
|
for _, p := range []string{"/proc", "/proc/"} {
|
|
if !mountedAt(p) {
|
|
t.Errorf("mountedAt(%q) = false, want true", p)
|
|
}
|
|
}
|
|
plain := t.TempDir()
|
|
for _, p := range []string{plain, plain + "/"} {
|
|
if mountedAt(p) {
|
|
t.Errorf("mountedAt(%q) = true, want false", p)
|
|
}
|
|
}
|
|
}
|