Skip to content

Commit ca4a0e3

Browse files
daeyeonMoLow
authored andcommitted
test: fix parsing test flags
This removes replacing `_` with `-` in the flags defined. Signed-off-by: Daeyeon Jeong <[email protected]> PR-URL: #48012 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 2ba08ac commit ca4a0e3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/common/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ function parseTestFlags(filename = process.argv[1]) {
8181
}
8282
return source
8383
.substring(flagStart, flagEnd)
84-
.replace(/_/g, '-')
8584
.split(/\s+/)
8685
.filter(Boolean);
8786
}
@@ -97,9 +96,8 @@ if (process.argv.length === 2 &&
9796
require('cluster').isPrimary &&
9897
fs.existsSync(process.argv[1])) {
9998
const flags = parseTestFlags();
100-
const args = process.execArgv.map((arg) => arg.replace(/_/g, '-'));
10199
for (const flag of flags) {
102-
if (!args.includes(flag) &&
100+
if (!process.execArgv.includes(flag) &&
103101
// If the binary is build without `intl` the inspect option is
104102
// invalid. The test itself should handle this case.
105103
(process.features.inspector || !flag.startsWith('--inspect'))) {

0 commit comments

Comments
 (0)