From dc51ed218070fcd074e67404e5a658b1c400e777 Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Sat, 31 Jan 2015 14:48:14 +1100 Subject: [PATCH] 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/3682 Reviewed-by: Brad Fitzpatrick --- src/os/path_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/path_test.go b/src/os/path_test.go index bf7308a3eb..7252e870ce 100644 --- a/src/os/path_test.go +++ b/src/os/path_test.go @@ -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) } -- 2.48.1