]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function shouldBe(actual, expected) { |
2 | if (actual !== expected) | |
3 | throw new Error('bad value: ' + actual); | |
4 | } | |
5 | ||
6 | var reg1 = /Cocoa/gi; | |
7 | shouldBe(reg1.global, true); | |
8 | shouldBe(reg1.ignoreCase, true); | |
9 | shouldBe(reg1.multiline, false); | |
10 | shouldBe(reg1.source, 'Cocoa'); | |
11 | ||
12 | var reg2 = /Cocoa/im; | |
13 | shouldBe(reg2.global, false); | |
14 | shouldBe(reg2.ignoreCase, true); | |
15 | shouldBe(reg2.multiline, true); | |
16 | shouldBe(reg2.source, 'Cocoa'); | |
17 | ||
18 | var reg3 = /Cappuccino/gm; | |
19 | shouldBe(reg3.global, true); | |
20 | shouldBe(reg3.ignoreCase, false); | |
21 | shouldBe(reg3.multiline, true); | |
22 | shouldBe(reg3.source, 'Cappuccino'); |