Skip to content

Commit

Permalink
test: remove unneeded m flag on regular expressions
Browse files Browse the repository at this point in the history
The m flag has no effect on regular expressions that don't match the
start or the end of a line.

PR-URL: #38124
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Trott authored and targos committed May 1, 2021
1 parent e999da7 commit 552c945
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ const child = spawnSync(process.execPath, [
'--expose-gc', __filename, 'child'
]);
assert.strictEqual(child.signal, null);
assert.match(child.stderr.toString(), /Error during Finalize/m);
assert.match(child.stderr.toString(), /Error during Finalize/);
2 changes: 1 addition & 1 deletion test/parallel/test-readline-async-iterators.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function testSimple() {
expectedLines.pop();
}
assert.deepStrictEqual(iteratedLines, expectedLines);
assert.strictEqual(iteratedLines.join(''), fileContent.replace(/\n/gm, ''));
assert.strictEqual(iteratedLines.join(''), fileContent.replace(/\n/g, ''));
}
}

Expand Down
6 changes: 3 additions & 3 deletions test/report/test-report-uv-handles.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ if (process.argv[2] === 'child') {

// Test libuv handle key order
{
const get_libuv = /"libuv":\s\[([\s\S]*?)\]/gm;
const get_handle_inner = /{([\s\S]*?),*?}/gm;
const get_libuv = /"libuv":\s\[([\s\S]*?)\]/g;
const get_handle_inner = /{([\s\S]*?),*?}/g;
const libuv_handles_str = get_libuv.exec(stdout)[1];
const libuv_handles_array = libuv_handles_str.match(get_handle_inner);
for (const i of libuv_handles_array) {
// Exclude nested structure
if (i.includes('type')) {
const handle_keys = i.match(/(".*"):/gm);
const handle_keys = i.match(/(".*"):/g);
assert(handle_keys[0], 'type');
assert(handle_keys[1], 'is_active');
}
Expand Down

0 comments on commit 552c945

Please sign in to comment.