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