MCPcopy Create free account
hub / github.com/nodejs/node / assertMatchAll

Function assertMatchAll

deps/v8/test/mjsunit/regexp-duplicate-named-groups.js:133–139  ·  view source on GitHub ↗
(matches, expected)

Source from the content-addressed store, hash-verified

131 'xzzyyxxy'.split(/(?:(?:(?<a>x)|(?<a>y)|(a)|(?<b>b)|(?<a>z))\k<a>)/));
132
133function assertMatchAll(matches, expected) {
134 let i = 0;
135 for (match of matches) {
136 assertEquals(expected[i], match);
137 i++;
138 }
139}
140assertMatchAll(
141 'xyx'.matchAll(/(?<a>x)|(?<a>y)/g),
142 [['x', 'x', undefined], ['y', undefined, 'y'], ['x', 'x', undefined]]);

Calls 1

assertEqualsFunction · 0.50

Tested by

no test coverage detected