]> Cypherpunks repositories - gostls13.git/commitdiff
path/filepath: fix TestEvalSymlinks when run under symlinked GOROOT
authorAndrew Gerrand <adg@golang.org>
Mon, 21 Mar 2011 00:24:48 +0000 (11:24 +1100)
committerAndrew Gerrand <adg@golang.org>
Mon, 21 Mar 2011 00:24:48 +0000 (11:24 +1100)
Fixes #1622.

R=rsc, bradfitzgo
CC=golang-dev
https://golang.org/cl/4287063

src/pkg/path/filepath/path_test.go

index 5c891dee6241f11c8ea24b013fd0c29fdbc468dd..2af6e5132438403e493888fd39b2bf381a0b1480 100644 (file)
@@ -465,7 +465,11 @@ func TestEvalSymlinks(t *testing.T) {
                }
        }
        // absolute
-       testroot := filepath.Join(os.Getenv("GOROOT"), "src", "pkg", "path", "filepath")
+       goroot, err := filepath.EvalSymlinks(os.Getenv("GOROOT"))
+       if err != nil {
+               t.Fatalf("EvalSymlinks(%q) error: %v", os.Getenv("GOROOT"), err)
+       }
+       testroot := filepath.Join(goroot, "src", "pkg", "path", "filepath")
        for _, d := range EvalSymlinksTests {
                a := EvalSymlinksTest{
                        filepath.Join(testroot, d.path),