Index: test/webkit/fast/js/regexp-bol.js |
diff --git a/test/webkit/regexp-extended-characters-match.js b/test/webkit/fast/js/regexp-bol.js |
similarity index 53% |
copy from test/webkit/regexp-extended-characters-match.js |
copy to test/webkit/fast/js/regexp-bol.js |
index de4027526536877edc1dd6597363e65f32424b97..a28d4d5f41205e4bf91a0af927ac9386acd19868 100644 |
--- a/test/webkit/regexp-extended-characters-match.js |
+++ b/test/webkit/fast/js/regexp-bol.js |
@@ -22,19 +22,28 @@ |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
description( |
-"This test checks regular expressions using extended (> 255) characters and character classes." |
+'Test for beginning of line (BOL or ^) matching</a>' |
); |
-// shouldThrow('var r = new RegExp("[\u0101-\u0100]"); r.exec("a")', 'null'); |
- |
-shouldBe('(new RegExp("[\u0100-\u0101]")).exec("a")', 'null'); |
-shouldBe('(new RegExp("[\u0100]")).exec("a")', 'null'); |
-shouldBe('(new RegExp("\u0100")).exec("a")', 'null'); |
-shouldBe('(new RegExp("[\u0061]")).exec("a").toString()', '"a"'); |
-shouldBe('(new RegExp("[\u0100-\u0101a]")).exec("a").toString()', '"a"'); |
-shouldBe('(new RegExp("[\u0100a]")).exec("a").toString()', '"a"'); |
-shouldBe('(new RegExp("\u0061")).exec("a").toString()', '"a"'); |
-shouldBe('(new RegExp("[a-\u0100]")).exec("a").toString()', '"a"'); |
-shouldBe('(new RegExp("[\u0100]")).exec("\u0100").toString()', '"\u0100"'); |
-shouldBe('(new RegExp("[\u0100-\u0101]")).exec("\u0100").toString()', '"\u0100"'); |
-shouldBe('(new RegExp("\u0100")).exec("\u0100").toString()', '"\u0100"'); |
+var s = "abc123def456xyzabc789abc999"; |
+shouldBeNull('s.match(/^notHere/)'); |
+shouldBe('s.match(/^abc/)', '["abc"]'); |
+shouldBe('s.match(/(^|X)abc/)', '["abc",""]'); |
+shouldBe('s.match(/^longer|123/)', '["123"]'); |
+shouldBe('s.match(/(^abc|c)123/)', '["abc123","abc"]'); |
+shouldBe('s.match(/(c|^abc)123/)', '["abc123","abc"]'); |
+shouldBe('s.match(/(^ab|abc)123/)', '["abc123","abc"]'); |
+shouldBe('s.match(/(bc|^abc)([0-9]*)a/)', '["bc789a","bc","789"]'); |
+shouldBeNull('/(?:(Y)X)|(X)/.exec("abc")'); |
+shouldBeNull('/(?:(?:^|Y)X)|(X)/.exec("abc")'); |
+shouldBeNull('/(?:(?:^|Y)X)|(X)/.exec("abcd")'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("Xabcd")', '["X",undefined]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("aXbcd")', '["X","X"]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abXcd")', '["X","X"]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abcXd")', '["X","X"]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abcdX")', '["X","X"]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("YXabcd")', '["YX",undefined]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("aYXbcd")', '["YX",undefined]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abYXcd")', '["YX",undefined]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abcYXd")', '["YX",undefined]'); |
+shouldBe('/(?:(?:^|Y)X)|(X)/.exec("abcdYX")', '["YX",undefined]'); |