Skip to content

Commit

Permalink
fix TestRemoveAll again (tested as root this time).
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Nov 11, 2009
1 parent 2643f74 commit 2cda46d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/pkg/os/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2cda46d

Please sign in to comment.