mirror of
https://github.com/golang/go
synced 2024-11-24 17:40:14 -07:00
os: Fix test to work on Solaris.
On Solaris /bin is a symlink to /usr/bin, so running "pwd" in the directory "/bin" prints out "/usr/bin". R=rsc, r, bradfitz CC=golang-dev https://golang.org/cl/4559043
This commit is contained in:
parent
c4918db8b9
commit
ddcdbd4470
@ -442,7 +442,8 @@ func exec(t *testing.T, dir, cmd string, args []string, expect string) {
|
|||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
io.Copy(&b, r)
|
io.Copy(&b, r)
|
||||||
output := b.String()
|
output := b.String()
|
||||||
if output != expect {
|
// Accept /usr prefix because Solaris /bin is symlinked to /usr/bin.
|
||||||
|
if output != expect && output != "/usr"+expect {
|
||||||
t.Errorf("exec %q returned %q wanted %q",
|
t.Errorf("exec %q returned %q wanted %q",
|
||||||
strings.Join(append([]string{cmd}, args...), " "), output, expect)
|
strings.Join(append([]string{cmd}, args...), " "), output, expect)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user