Commit ad50408f authored by Hiroshi Ioka's avatar Hiroshi Ioka Committed by Brad Fitzpatrick

path/filepath: simplify TestToNorm

Change-Id: I8a176ed9c7f59ebdfd39c1e2b88905f977179982
Reviewed-on: https://go-review.googlesource.com/31119Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 0cc400f0
......@@ -383,10 +383,12 @@ func TestToNorm(t *testing.T) {
tmpVol := filepath.VolumeName(tmp)
tmpNoVol := tmp[len(tmpVol):]
replacer := strings.NewReplacer("{{tmp}}", tmp, "{{tmpvol}}", tmpVol, "{{tmpnovol}}", tmpNoVol)
for _, test := range testsDir {
wd := strings.Replace(strings.Replace(strings.Replace(test.wd, "{{tmp}}", tmp, -1), "{{tmpvol}}", tmpVol, -1), "{{tmpnovol}}", tmpNoVol, -1)
arg := strings.Replace(strings.Replace(strings.Replace(test.arg, "{{tmp}}", tmp, -1), "{{tmpvol}}", tmpVol, -1), "{{tmpnovol}}", tmpNoVol, -1)
want := strings.Replace(strings.Replace(strings.Replace(test.want, "{{tmp}}", tmp, -1), "{{tmpvol}}", tmpVol, -1), "{{tmpnovol}}", tmpNoVol, -1)
wd := replacer.Replace(test.wd)
arg := replacer.Replace(test.arg)
want := replacer.Replace(test.want)
if test.wd == "." {
err := os.Chdir(cwd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment