diff options
| author | Alex Brainman <alex.brainman@gmail.com> | 2012-03-27 12:56:56 +1100 |
|---|---|---|
| committer | Alex Brainman <alex.brainman@gmail.com> | 2012-03-27 12:56:56 +1100 |
| commit | cf13bd3fab523931c3555c82c3d2fe896d2935c9 (patch) | |
| tree | d4715f7a6fb73ae8b3bd991c0fc5ad0130f9a868 /src/pkg/path/filepath/path_test.go | |
| parent | 9031f952e2b17752f4eb716d4d96575026ce5338 (diff) | |
| download | go-cf13bd3fab523931c3555c82c3d2fe896d2935c9.tar.xz | |
path/filepath: convert drive letter to upper case in windows EvalSymlinks
Fixes #3347.
R=golang-dev, aram, r, rsc
CC=golang-dev
https://golang.org/cl/5918043
Diffstat (limited to 'src/pkg/path/filepath/path_test.go')
| -rw-r--r-- | src/pkg/path/filepath/path_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pkg/path/filepath/path_test.go b/src/pkg/path/filepath/path_test.go index 2aba553d23..b8766588cf 100644 --- a/src/pkg/path/filepath/path_test.go +++ b/src/pkg/path/filepath/path_test.go @@ -846,3 +846,26 @@ func TestVolumeName(t *testing.T) { } } } + +func TestDriveLetterInEvalSymlinks(t *testing.T) { + if runtime.GOOS != "windows" { + return + } + wd, _ := os.Getwd() + if len(wd) < 3 { + t.Errorf("Current directory path %q is too short", wd) + } + lp := strings.ToLower(wd) + up := strings.ToUpper(wd) + flp, err := filepath.EvalSymlinks(lp) + if err != nil { + t.Fatalf("EvalSymlinks(%q) failed: %q", lp, err) + } + fup, err := filepath.EvalSymlinks(up) + if err != nil { + t.Fatalf("EvalSymlinks(%q) failed: %q", up, err) + } + if flp != fup { + t.Errorf("Results of EvalSymlinks do not match: %q and %q", flp, fup) + } +} |
