From fac92613cce0d60f6794ad850618ed64d04c76fd Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov (VMware)" Date: Wed, 25 Apr 2018 22:58:41 +0300 Subject: [PATCH] path/filepath: fix Win32 tests missing 'chcp' '%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 --- src/path/filepath/path_windows_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go index 2ec5f5ef4404d4..e36a3c9b646367 100644 --- a/src/path/filepath/path_windows_test.go +++ b/src/path/filepath/path_windows_test.go @@ -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()