Skip to content

Commit

Permalink
test: fix parsing test flags
Browse files Browse the repository at this point in the history
This removes replacing `_` with `-` in the flags defined.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: nodejs#48012
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
daeyeon authored and MoLow committed Jul 6, 2023
1 parent 2ba08ac commit ca4a0e3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ function parseTestFlags(filename = process.argv[1]) {
}
return source
.substring(flagStart, flagEnd)
.replace(/_/g, '-')
.split(/\s+/)
.filter(Boolean);
}
Expand All @@ -97,9 +96,8 @@ if (process.argv.length === 2 &&
require('cluster').isPrimary &&
fs.existsSync(process.argv[1])) {
const flags = parseTestFlags();
const args = process.execArgv.map((arg) => arg.replace(/_/g, '-'));
for (const flag of flags) {
if (!args.includes(flag) &&
if (!process.execArgv.includes(flag) &&
// If the binary is build without `intl` the inspect option is
// invalid. The test itself should handle this case.
(process.features.inspector || !flag.startsWith('--inspect'))) {
Expand Down

0 comments on commit ca4a0e3

Please sign in to comment.