1
0
mirror of https://github.com/golang/go synced 2024-11-19 13:54:56 -07:00

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
This commit is contained in:
Aram Hăvărneanu 2014-07-09 12:31:20 +02:00
parent 8aea9a00a8
commit a6cc634766

View File

@ -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