Commit 03563683 authored by Aaron Jacobs's avatar Aaron Jacobs

Switch to a test that can pass on OS X, too.

It appears osxfuse is happy to mount over a non-empty directory.
parent 8b7833ba
...@@ -65,7 +65,7 @@ func TestSuccessfulMount(t *testing.T) { ...@@ -65,7 +65,7 @@ func TestSuccessfulMount(t *testing.T) {
defer fuse.Unmount(mfs.Dir()) defer fuse.Unmount(mfs.Dir())
} }
func TestNonEmptyMountPoint(t *testing.T) { func TestNonexistentMountPoint(t *testing.T) {
ctx := context.Background() ctx := context.Background()
// Set up a temporary directory. // Set up a temporary directory.
...@@ -76,16 +76,10 @@ func TestNonEmptyMountPoint(t *testing.T) { ...@@ -76,16 +76,10 @@ func TestNonEmptyMountPoint(t *testing.T) {
defer os.RemoveAll(dir) defer os.RemoveAll(dir)
// Add a file within it. // Attempt to mount into a sub-directory that doesn't exist.
err = ioutil.WriteFile(path.Join(dir, "foo"), []byte{}, 0600)
if err != nil {
t.Fatalf("ioutil.WriteFile: %v", err)
}
// Attempt to mount.
fs := &minimalFS{} fs := &minimalFS{}
mfs, err := fuse.Mount( mfs, err := fuse.Mount(
dir, path.Join(dir, "foo"),
fuseutil.NewFileSystemServer(fs), fuseutil.NewFileSystemServer(fs),
&fuse.MountConfig{}) &fuse.MountConfig{})
...@@ -95,7 +89,7 @@ func TestNonEmptyMountPoint(t *testing.T) { ...@@ -95,7 +89,7 @@ func TestNonEmptyMountPoint(t *testing.T) {
t.Fatal("fuse.Mount returned nil") t.Fatal("fuse.Mount returned nil")
} }
const want = "not empty" const want = "no such file"
if got := err.Error(); !strings.Contains(got, want) { if got := err.Error(); !strings.Contains(got, want) {
t.Errorf("Unexpected error: %v", got) t.Errorf("Unexpected error: %v", got)
} }
......
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