Skip to content

Commit

Permalink
src/testUtils: fix lost previous test function name
Browse files Browse the repository at this point in the history
targetArgs mutates the testconfig.functions, that's an alias of lastTestConfig.
A better fix is probably to avoid the alias at the first place and store a complete
clone as the lastTestConfig, but I don't know how efficiently that can be done.

But anyway, mutating the configuration on the fly is not desirable. So, avoid it.

Fixes golang#269

Change-Id: I29651f07e555b5e604ca1c9901fc0572f3a553cf
GitHub-Last-Rev: e2297a0
GitHub-Pull-Request: golang#272
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/240517
Reviewed-by: Rebecca Stambler <[email protected]>
  • Loading branch information
hyangah committed Jul 1, 2020
1 parent 1be5ec9 commit 761a4fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function targetArgs(testconfig: TestConfig): Array<string> {
// which will result in the correct thing to happen
if (testFunctions.length > 0) {
if (testFunctions.length === 1) {
params = params.concat(['-run', util.format('^%s$', testFunctions.pop())]);
params = params.concat(['-run', util.format('^%s$', testFunctions[0])]);
} else {
params = params.concat(['-run', util.format('^(%s)$', testFunctions.join('|'))]);
}
Expand Down

0 comments on commit 761a4fc

Please sign in to comment.