aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/path
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-02-26 01:00:39 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-02-26 01:00:39 +0000
commit99e20ba51d5b0785c7e98244d2901853d9fb3b41 (patch)
treed86fa5d601b8bc3629b3820df4d5e7042853453f /libgo/go/path
parente5e9b91bc61da0bdb58c6577c319e61a3ed04b17 (diff)
downloadgcc-99e20ba51d5b0785c7e98244d2901853d9fb3b41.zip
gcc-99e20ba51d5b0785c7e98244d2901853d9fb3b41.tar.gz
gcc-99e20ba51d5b0785c7e98244d2901853d9fb3b41.tar.bz2
libgo: update to Go1.12rc1
Reviewed-on: https://go-review.googlesource.com/c/162881 From-SVN: r269202
Diffstat (limited to 'libgo/go/path')
-rw-r--r--libgo/go/path/filepath/path_test.go22
1 files changed, 18 insertions, 4 deletions
diff --git a/libgo/go/path/filepath/path_test.go b/libgo/go/path/filepath/path_test.go
index 4840f9d..deeb47e 100644
--- a/libgo/go/path/filepath/path_test.go
+++ b/libgo/go/path/filepath/path_test.go
@@ -1378,13 +1378,27 @@ func TestWalkSymlink(t *testing.T) {
}
func TestIssue29372(t *testing.T) {
- f, err := ioutil.TempFile("", "issue29372")
+ tmpDir, err := ioutil.TempDir("", "TestIssue29372")
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer os.RemoveAll(tmpDir)
+
+ if runtime.GOOS == "windows" {
+ // This test is broken on windows, if temporary directory
+ // is a symlink. See issue 29746.
+ // TODO(brainman): Remove this hack once issue #29746 is fixed.
+ tmpDir, err = filepath.EvalSymlinks(tmpDir)
+ if err != nil {
+ t.Fatal(err)
+ }
+ }
+
+ path := filepath.Join(tmpDir, "file.txt")
+ err = ioutil.WriteFile(path, nil, 0644)
if err != nil {
t.Fatal(err)
}
- f.Close()
- path := f.Name()
- defer os.Remove(path)
pathSeparator := string(filepath.Separator)
tests := []string{