]> Cypherpunks repositories - gostls13.git/commitdiff
path/filepath: fix Win32 tests missing 'chcp'
authorLubomir I. Ivanov (VMware) <neolit123@gmail.com>
Wed, 25 Apr 2018 20:59:04 +0000 (20:59 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 26 Apr 2018 18:25:15 +0000 (18:25 +0000)
'%SystemRoot%/System32/chcp.com' is a tool on Windows that
is used to change the active code page in the console.

'go test path/filepath' can fail with:
"'chcp' is not recognized as an internal or external command"

The test uses a custom PATH variable but does not include
'%SystemRoot%/System32'. Always append that to PATH.

Updates #24709

Change-Id: Ib4c83ffdcc5dd6eb7bb34c07386cf2ab61dcae57
GitHub-Last-Rev: fac92613cce0d60f6794ad850618ed64d04c76fd
GitHub-Pull-Request: golang/go#25089
Reviewed-on: https://go-review.googlesource.com/109362
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/path/filepath/path_windows_test.go

index 2ec5f5ef4404d467f85334ab15485f7f4f7458ba..e36a3c9b646367e69ec9a0a1a58f37e90612e028 100644 (file)
@@ -79,7 +79,7 @@ func testWinSplitListTestIsValid(t *testing.T, ti int, tt SplitListTest,
                cmd := &exec.Cmd{
                        Path: comspec,
                        Args: []string{`/c`, cmdfile},
-                       Env:  []string{`Path=` + tt.list, `SystemRoot=` + systemRoot},
+                       Env:  []string{`Path=` + systemRoot + "/System32;" + tt.list, `SystemRoot=` + systemRoot},
                        Dir:  tmp,
                }
                out, err := cmd.CombinedOutput()