Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testscript: add ${/} as a companion to ${:} #90

Merged
merged 1 commit into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions testscript/testdata/exec_path_change.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# If the PATH environment variable is set in the testscript.Params.Setup phase
# or set directly within a script, exec should honour that PATH

[!windows] env HOME=$WORK/home
[windows] env HOME=$WORK\home
[windows] env USERPROFILE=$WORK\home
[windows] env LOCALAPPDATA=$WORK\appdata
[!exec:go] skip

env HOME=$WORK${/}home
[windows] env USERPROFILE=$WORK\home
[windows] env LOCALAPPDATA=$WORK\appdata

cd go
exec go$exe version
stdout 'go version'
exec go$exe build
[!windows] env PATH=$WORK/go${:}$PATH
[windows] env PATH=$WORK\go${:}$PATH
env PATH=$WORK${/}go${:}$PATH
exec go$exe version
stdout 'This is not go'

Expand Down
6 changes: 4 additions & 2 deletions testscript/testdata/stdin.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[!exec:cat] skip

stdin hello.txt
[exec:cat] exec cat
exec cat
stdout hello
[exec:cat] exec cat
exec cat
! stdout hello

-- hello.txt --
Expand Down
1 change: 1 addition & 0 deletions testscript/testscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ func (ts *TestScript) setup() string {
homeEnvName() + "=/no-home",
tempEnvName() + "=" + filepath.Join(ts.workdir, "tmp"),
"devnull=" + os.DevNull,
"/=" + string(os.PathSeparator),
":=" + string(os.PathListSeparator),
},
WorkDir: ts.workdir,
Expand Down