Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

wrap values choice in brackets #2155

Merged
merged 1 commit into from
Nov 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function targetArgs(testconfig: TestConfig): Array<string> {

if (testconfig.functions) {
if (testconfig.isBenchmark) {
params = ['-bench', util.format('^%s$', testconfig.functions.join('|'))];
params = ['-bench', util.format('^(%s)$', testconfig.functions.join('|'))];
} else {
let testFunctions = testconfig.functions;
let testifyMethods = testFunctions.filter(fn => testMethodRegex.test(fn));
Expand All @@ -372,10 +372,10 @@ function targetArgs(testconfig: TestConfig): Array<string> {
// in running all the test methods, but one of them should call testify's `suite.Run(...)`
// which will result in the correct thing to happen
if (testFunctions.length > 0) {
params = params.concat(['-run', util.format('^%s$', testFunctions.join('|'))]);
params = params.concat(['-run', util.format('^(%s)$', testFunctions.join('|'))]);
}
if (testifyMethods.length > 0) {
params = params.concat(['-testify.m', util.format('^%s$', testifyMethods.join('|'))]);
params = params.concat(['-testify.m', util.format('^(%s)$', testifyMethods.join('|'))]);
}
}
return params;
Expand Down