(condition: boolean, msg: string)
| 29 | let failed = 0; |
| 30 | |
| 31 | function assert(condition: boolean, msg: string) { |
| 32 | if (condition) { |
| 33 | console.log(` ✓ ${msg}`); |
| 34 | passed++; |
| 35 | } else { |
| 36 | console.error(` ✗ FAIL: ${msg}`); |
| 37 | failed++; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | // ─── Part 1: Rule-Based Classifier ─── |
| 42 |