Fix common/download_test.go to avoid formatting the volume name to a hidden windows share when not on windows.

This commit is contained in:
Ali Rizvi-Santiago 2017-03-23 15:12:25 -05:00
parent d275bacb0f
commit 4783b6508e
1 changed files with 4 additions and 1 deletions

View File

@ -452,7 +452,10 @@ func TestFileUriTransforms(t *testing.T) {
cwd = filepath.ToSlash(cwd)
volume = filepath.VolumeName(cwd)
share = volume
if share[len(share)-1] == ':' {
// if a volume was found (on windows), replace the ':' from
// C: to C$ to convert it into a hidden windows share.
if len(share) > 1 && share[len(share)-1] == ':' {
share = share[:len(share)-1] + "$"
}
cwd = cwd[len(volume):]