| OLD | NEW |
| (Empty) |
| 1 description( | |
| 2 "This page tests handling of malformed escape sequences." | |
| 3 ); | |
| 4 | |
| 5 var regexp; | |
| 6 | |
| 7 regexp = /\ug/gm; | |
| 8 debug("\nTesting regexp: " + regexp); | |
| 9 shouldBeTrue("regexp.test('ug')"); | |
| 10 shouldBe("regexp.lastIndex", "2"); | |
| 11 | |
| 12 regexp = /\xg/gm; | |
| 13 debug("\nTesting regexp: " + regexp); | |
| 14 shouldBeTrue("regexp.test('xg')"); | |
| 15 shouldBe("regexp.lastIndex", "2"); | |
| 16 | |
| 17 regexp = /\c_/gm; | |
| 18 debug("\nTesting regexp: " + regexp); | |
| 19 shouldBeTrue("regexp.test('\\\\c_')"); | |
| 20 shouldBe("regexp.lastIndex", "3"); | |
| 21 | |
| 22 regexp = /[\B]/gm; | |
| 23 debug("\nTesting regexp: " + regexp); | |
| 24 shouldBeTrue("regexp.test('B')"); | |
| 25 shouldBe("regexp.lastIndex", "1"); | |
| 26 | |
| 27 regexp = /[\b]/gm; | |
| 28 debug("\nTesting regexp: " + regexp); | |
| 29 shouldBeTrue("regexp.test('\\b')"); | |
| 30 shouldBe("regexp.lastIndex", "1"); | |
| 31 | |
| 32 regexp = /\8/gm; | |
| 33 debug("\nTesting regexp: " + regexp); | |
| 34 shouldBeTrue("regexp.test('\\\\8')"); | |
| 35 shouldBe("regexp.lastIndex", "2"); | |
| 36 | |
| 37 regexp = /^[\c]$/; | |
| 38 debug("\nTesting regexp: " + regexp); | |
| 39 shouldBeTrue("regexp.test('c')"); | |
| 40 | |
| 41 regexp = /^[\c_]$/; | |
| 42 debug("\nTesting regexp: " + regexp); | |
| 43 shouldBeFalse("regexp.test('c')"); | |
| 44 | |
| 45 regexp = /^[\c]]$/; | |
| 46 debug("\nTesting regexp: " + regexp); | |
| 47 shouldBeTrue("regexp.test('c]')"); | |
| OLD | NEW |