From: Aram Hăvărneanu Date: Wed, 9 Jul 2014 10:31:20 +0000 (+0200) Subject: os: fix failing test on Plan 9 X-Git-Tag: go1.4beta1~1141 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a6cc6347669408a2d72779743d32588c9a528315;p=gostls13.git os: fix failing test on Plan 9 LGTM=0intro, r R=0intro, r CC=ality, dave, golang-codereviews, jas, mischief, rsc https://golang.org/cl/105580044 --- diff --git a/src/pkg/os/os_test.go b/src/pkg/os/os_test.go index d6f369c8bf..02010000a6 100644 --- a/src/pkg/os/os_test.go +++ b/src/pkg/os/os_test.go @@ -926,6 +926,12 @@ func TestOpenError(t *testing.T) { syscallErrStr := perr.Err.Error() expectedErrStr := strings.Replace(tt.error.Error(), "file ", "", 1) if !strings.HasSuffix(syscallErrStr, expectedErrStr) { + // Some Plan 9 file servers incorrectly return + // EACCES rather than EISDIR when a directory is + // opened for write. + if tt.error == syscall.EISDIR && strings.HasSuffix(syscallErrStr, syscall.EACCES.Error()) { + continue + } t.Errorf("Open(%q, %d) = _, %q; want suffix %q", tt.path, tt.mode, syscallErrStr, expectedErrStr) } continue