test: remove unneeded m flag on regular expressions
The m flag has no effect on regular expressions that don't match the start or the end of a line. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
269f5132cc
commit
7e516aaac0
@ -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/);
|
||||
|
@ -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, ''));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user