From: Ian Lance Taylor Date: Wed, 25 May 2011 05:53:37 +0000 (-0700) Subject: os: Fix test to work on Solaris. X-Git-Tag: weekly.2011-06-02~119 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ddcdbd447084da04aede72356dadd99a08a96cc9;p=gostls13.git 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 --- diff --git a/src/pkg/os/os_test.go b/src/pkg/os/os_test.go index b06d57b851..b146b92cf0 100644 --- a/src/pkg/os/os_test.go +++ b/src/pkg/os/os_test.go @@ -442,7 +442,8 @@ func exec(t *testing.T, dir, cmd string, args []string, expect string) { var b bytes.Buffer io.Copy(&b, r) 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", strings.Join(append([]string{cmd}, args...), " "), output, expect) }