diff options
| author | Hiroshi Ioka <hirochachacha@gmail.com> | 2016-08-23 22:59:27 +0900 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-08-23 14:53:47 +0000 |
| commit | 03723c909ee7b75c0c88ddb3f547642b9f48b009 (patch) | |
| tree | e11cc514e51499f629f93f79f6df735eb9048865 /src/path/filepath/path_windows_test.go | |
| parent | e893c72f2a5ec41bbf14f23b95ae10caf609260a (diff) | |
| download | go-03723c909ee7b75c0c88ddb3f547642b9f48b009.tar.xz | |
path/filepath: use testenv.MustHaveSymlink to simplify symlink tests
Cleanup test code for symbolic links.
Change-Id: I25f561cd34dc4d120a4143f933619d233a6cffc5
Reviewed-on: https://go-review.googlesource.com/27573
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/path/filepath/path_windows_test.go')
| -rw-r--r-- | src/path/filepath/path_windows_test.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go index b47cdfdb96..180c2e90af 100644 --- a/src/path/filepath/path_windows_test.go +++ b/src/path/filepath/path_windows_test.go @@ -13,29 +13,9 @@ import ( "path/filepath" "reflect" "strings" - "syscall" "testing" ) -func init() { - tmpdir, err := ioutil.TempDir("", "symtest") - if err != nil { - panic("failed to create temp directory: " + err.Error()) - } - defer os.RemoveAll(tmpdir) - - err = os.Symlink("target", filepath.Join(tmpdir, "symlink")) - if err == nil { - return - } - - err = err.(*os.LinkError).Err - switch err { - case syscall.EWINDOWS, syscall.ERROR_PRIVILEGE_NOT_HELD: - supportsSymlinks = false - } -} - func TestWinSplitListTestsAreValid(t *testing.T) { comspec := os.Getenv("ComSpec") if comspec == "" { |
