(regexp, yes, no)
| 30 | |
| 31 | |
| 32 | function verify(regexp, yes, no) { |
| 33 | // Ignore unfinished exercises |
| 34 | if (regexp.source == "...") return; |
| 35 | for (let str of yes) if (!regexp.test(str)) { |
| 36 | console.log(`Failure to match '${str}'`); |
| 37 | } |
| 38 | for (let str of no) if (regexp.test(str)) { |
| 39 | console.log(`Unexpected match for '${str}'`); |
| 40 | } |
| 41 | } |