(re, expectedMatch, expectedNoMatch = [])
| 37 | test_invalid('(?-!)'); |
| 38 | |
| 39 | function 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 | |
| 48 | test(/(?i:ba)r/, ['bar', 'Bar', 'BAr'], ['BAR', 'BaR']); |
| 49 | test(/(?-i:ba)r/i, ['bar', 'baR'], ['Bar', 'BAR']); |
no test coverage detected
searching dependent graphs…