From fef2721042e40a9b6aa096b0362c7c23d241a974 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Mon, 23 Mar 2015 10:43:32 +1100 Subject: [PATCH] Fixed FlushFSTest.Dup_FlushError for darwin. --- samples/flushfs/flush_fs_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/samples/flushfs/flush_fs_test.go b/samples/flushfs/flush_fs_test.go index 2ac0091..ebdc0f6 100644 --- a/samples/flushfs/flush_fs_test.go +++ b/samples/flushfs/flush_fs_test.go @@ -496,12 +496,18 @@ func (t *FlushFSTest) Dup_FlushError() { // Configure a flush error. t.setFlushError(fuse.ENOENT) - // Close by the first handle. + // Close by the first handle. On OS X, where the semantics of file handles + // are different (cf. https://github.com/osxfuse/osxfuse/issues/199), this + // does not result in an error. err = t.f1.Close() t.f1 = nil - AssertNe(nil, err) - ExpectThat(err, Error(HasSubstr("no such file"))) + if runtime.GOOS == "darwin" { + AssertEq(nil, err) + } else { + AssertNe(nil, err) + ExpectThat(err, Error(HasSubstr("no such file"))) + } // Close by the second handle. err = t.f2.Close()