Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: test/webkit/fast/js/regexp-bol.js

Issue 20280003: Migrate more tests from blink repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/webkit/fast/js/read-modify-eval-expected.txt ('k') | test/webkit/fast/js/regexp-bol-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]');
« no previous file with comments | « test/webkit/fast/js/read-modify-eval-expected.txt ('k') | test/webkit/fast/js/regexp-bol-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698