]> Cypherpunks repositories - gostls13.git/commitdiff
os: Fix test to work on Solaris.
authorIan Lance Taylor <iant@golang.org>
Wed, 25 May 2011 05:53:37 +0000 (22:53 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 25 May 2011 05:53:37 +0000 (22:53 -0700)
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

index b06d57b85195ed49c42945455c2d687abe376ec8..b146b92cf0e8a2b30fb7b875b142e268cf6f1c73 100644 (file)
@@ -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)
        }