From: Russ Cox Date: Wed, 11 Nov 2009 23:48:38 +0000 (-0800) Subject: fix TestRemoveAll again (tested as root this time). X-Git-Tag: weekly.2009-11-12~16 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2cda46dc82ba15d61c067aaeb29b0d26e722af02;p=gostls13.git fix TestRemoveAll again (tested as root this time). Fixes #22. R=r https://golang.org/cl/154069 --- diff --git a/src/pkg/os/path_test.go b/src/pkg/os/path_test.go index 9b11ac1636..9b01bd5b64 100644 --- a/src/pkg/os/path_test.go +++ b/src/pkg/os/path_test.go @@ -134,14 +134,13 @@ func TestRemoveAll(t *testing.T) { if perr.Path != dpath { t.Fatalf("RemoveAll %q failed at %q not %q", path, perr.Path, dpath) } - } - - if err = Chmod(dpath, 0777); err != nil { - t.Fatalf("Chmod %q 0777: %s", dpath, err) - } - for _, s := range []string{fpath, path + "/zzz"} { - if _, err := Lstat(s); err == nil { - t.Fatalf("Lstat %q succeeded after partial RemoveAll", s) + if err = Chmod(dpath, 0777); err != nil { + t.Fatalf("Chmod %q 0777: %s", dpath, err) + } + for _, s := range []string{fpath, path + "/zzz"} { + if _, err := Lstat(s); err == nil { + t.Fatalf("Lstat %q succeeded after partial RemoveAll", s) + } } } if err = RemoveAll(path); err != nil {