MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

deps/v8/test/mjsunit/regexp-modifiers.js:39–46  ·  view source on GitHub ↗
(re, expectedMatch, expectedNoMatch = [])

Source from the content-addressed store, hash-verified

37test_invalid('(?-!)');
38
39function test(re, expectedMatch, expectedNoMatch = []) {
40 for (const match of expectedMatch) {
41 assertTrue(re.test(match), `${re}.test(${match})`);
42 }
43 for (const match of expectedNoMatch) {
44 assertFalse(re.test(match), `${re}.test(${match})`);
45 }
46}
47
48test(/(?i:ba)r/, ['bar', 'Bar', 'BAr'], ['BAR', 'BaR']);
49test(/(?-i:ba)r/i, ['bar', 'baR'], ['Bar', 'BAR']);

Callers 1

Calls 3

assertTrueFunction · 0.70
assertFalseFunction · 0.50
testMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…