]> Cypherpunks repositories - gostls13.git/commitdiff
os: don't silently skip test
authorDave Cheney <dave@cheney.net>
Sat, 31 Jan 2015 03:48:14 +0000 (14:48 +1100)
committerDave Cheney <dave@cheney.net>
Sat, 31 Jan 2015 05:53:22 +0000 (05:53 +0000)
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/3682
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/path_test.go

index bf7308a3eb6b4e952ea1137e64774eb3635ad85b..7252e870ce2af25650b2fb9eed8ae5f71c1b6890 100644 (file)
@@ -207,12 +207,13 @@ func TestMkdirAllAtSlash(t *testing.T) {
                t.Skipf("skipping on %s", runtime.GOOS)
        }
        RemoveAll("/_go_os_test")
-       err := MkdirAll("/_go_os_test/dir", 0777)
+       const dir = "/go_os_test/dir"
+       err := MkdirAll(dir, 0777)
        if err != nil {
                pathErr, ok := err.(*PathError)
                // common for users not to be able to write to /
                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)
        }