Skip to content

Commit

Permalink
path/filepath: fix Win32 tests missing 'chcp'
Browse files Browse the repository at this point in the history
'%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 golang#24709
  • Loading branch information
neolit123 committed Apr 25, 2018
1 parent 7500b29 commit fac9261
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/path/filepath/path_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fac9261

Please sign in to comment.