From 7e516aaac0ed707a99f1fc304cea10bb40e7fa6c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 6 Apr 2021 23:28:55 -0700 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- test/js-native-api/test_exception/testFinalizerException.js | 2 +- test/parallel/test-readline-async-iterators.js | 2 +- test/report/test-report-uv-handles.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/js-native-api/test_exception/testFinalizerException.js b/test/js-native-api/test_exception/testFinalizerException.js index 7ed2504fee9c11..16f8bd5fe76228 100644 --- a/test/js-native-api/test_exception/testFinalizerException.js +++ b/test/js-native-api/test_exception/testFinalizerException.js @@ -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/); diff --git a/test/parallel/test-readline-async-iterators.js b/test/parallel/test-readline-async-iterators.js index 671d6ae17cd165..2aa557a3363486 100644 --- a/test/parallel/test-readline-async-iterators.js +++ b/test/parallel/test-readline-async-iterators.js @@ -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, '')); } } diff --git a/test/report/test-report-uv-handles.js b/test/report/test-report-uv-handles.js index d2dd630c46d25f..32140cf887f919 100644 --- a/test/report/test-report-uv-handles.js +++ b/test/report/test-report-uv-handles.js @@ -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'); }