mirror of https://github.com/golang/go.git
os: fix TestProgWideChdir on darwin
On darwin, /tmp and /var directories are usually linked to /private. % cd $TMPDIR; pwd -L /var/.../T % pwd -P /private/var/.../T Change-Id: I277ff2d096344d9a80e6004a83e9fc3e1716348c Reviewed-on: https://go-review.googlesource.com/8842 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
d1eee2cebf
commit
3cbe7ea7e9
|
|
@ -1060,7 +1060,8 @@ func TestProgWideChdir(t *testing.T) {
|
|||
<-c
|
||||
pwd, err := Getwd()
|
||||
if err != nil {
|
||||
t.Fatal("Getwd: %v", err)
|
||||
t.Errorf("Getwd on goroutine %d: %v", i, err)
|
||||
return
|
||||
}
|
||||
cpwd <- pwd
|
||||
}(i)
|
||||
|
|
@ -1082,11 +1083,17 @@ func TestProgWideChdir(t *testing.T) {
|
|||
if err := Chdir(d); err != nil {
|
||||
t.Fatal("Chdir: %v", err)
|
||||
}
|
||||
// OS X sets TMPDIR to a symbolic link.
|
||||
// So we resolve our working directory again before the test.
|
||||
d, err = Getwd()
|
||||
if err != nil {
|
||||
t.Fatal("Getwd: %v", err)
|
||||
}
|
||||
close(c)
|
||||
for i := 0; i < N; i++ {
|
||||
pwd := <-cpwd
|
||||
if pwd != d {
|
||||
t.Errorf("Getwd returned %q want %q", pwd, d)
|
||||
t.Errorf("Getwd returned %q; want %q", pwd, d)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue