Commit dc51ed21 authored by Dave Cheney's avatar Dave Cheney

os: don't silently skip test

This is a followup to CL 3676.

Rather than silently returning from the test, a pass,
use the Skip facility to mark the test as skipped.

Change-Id: I90d237e770150bf8d69f14fb09874e70894a7f86
Reviewed-on: https://go-review.googlesource.com/3682Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 2ffe3255
...@@ -207,12 +207,13 @@ func TestMkdirAllAtSlash(t *testing.T) { ...@@ -207,12 +207,13 @@ func TestMkdirAllAtSlash(t *testing.T) {
t.Skipf("skipping on %s", runtime.GOOS) t.Skipf("skipping on %s", runtime.GOOS)
} }
RemoveAll("/_go_os_test") RemoveAll("/_go_os_test")
err := MkdirAll("/_go_os_test/dir", 0777) const dir = "/go_os_test/dir"
err := MkdirAll(dir, 0777)
if err != nil { if err != nil {
pathErr, ok := err.(*PathError) pathErr, ok := err.(*PathError)
// common for users not to be able to write to / // common for users not to be able to write to /
if ok && (pathErr.Err == syscall.EACCES || pathErr.Err == syscall.EROFS) { if ok && (pathErr.Err == syscall.EACCES || pathErr.Err == syscall.EROFS) {
return t.Skipf("could not create %v: %v", dir, err)
} }
t.Fatalf(`MkdirAll "/_go_os_test/dir": %v`, err) t.Fatalf(`MkdirAll "/_go_os_test/dir": %v`, err)
} }
......
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