From ddcdbd447084da04aede72356dadd99a08a96cc9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 24 May 2011 22:53:37 -0700 Subject: [PATCH] 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 --- src/pkg/os/os_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/os/os_test.go b/src/pkg/os/os_test.go index b06d57b8519..b146b92cf0e 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) }