Commit a938e529 authored by Manlio Perillo's avatar Manlio Perillo Committed by Bryan C. Mills
Browse files

cmd/go: fix a portability issue in the cd script command

Currently all script tests use the UNIX path separator with the cd
command, causing the PWD environment variable to have the incorrect path
separator on Windows.

Call filepath.FromSlash on the cd command argument.
Update the testdata/script/README to document that the cd argument must
use slashes.

Add a regression test.

To reproduce this issue, a test must use the cd command followed by a
stdout or stderr command containing the pattern $PWD.

Change-Id: Ib2dc5f185cc2476451402787996d14df91f7dddb
Reviewed-on: https://go-review.googlesource.com/c/go/+/319311


Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
parent d137b745
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment