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

Unified Diff: test/mjsunit/regress/regress-latin-1.js

Issue 11818025: Continues Latin-1 support. All tests pass with ENABLE_LATIN_1 flag. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM fix Created 7 years, 11 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
« src/string-search.h ('K') | « test/mjsunit/regexp-capture-3.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-latin-1.js
diff --git a/test/mjsunit/regress/regress-crbug-146910.js b/test/mjsunit/regress/regress-latin-1.js
similarity index 66%
copy from test/mjsunit/regress/regress-crbug-146910.js
copy to test/mjsunit/regress/regress-latin-1.js
index 1b2a60af7fd3fe2e23ef5a8589e6b81d425d2fd5..b1f006d95f6effc40c4997730a905203476c538b 100644
--- a/test/mjsunit/regress/regress-crbug-146910.js
+++ b/test/mjsunit/regress/regress-latin-1.js
@@ -28,6 +28,32 @@
assertEquals(String.fromCharCode(97, 220, 256), 'a' + '\u00DC' + '\u0100');
assertEquals(String.fromCharCode(97, 220, 256), 'a\u00DC\u0100');
+assertEquals(0x80, JSON.stringify("\x80").charCodeAt(1));
+
assertEquals(['a', 'b', '\xdc'], ['b', '\xdc', 'a'].sort());
-assertEquals(['\xfc\xdc', '\xfc'], new RegExp('(\xdc)\\1', 'i').exec('\xfc\xdc'));
+assertEquals(['\xfc\xdc', '\xfc'], new RegExp('(\xdc)\\1', 'i').exec('\xfc\xdc'));
+// Same test but for all values in Latin-1 range.
+var total_lo = 0;
+for (var i = 0; i < 0xff; i++) {
+ var base = String.fromCharCode(i);
+ var escaped = base;
+ if (base == '(' || base == ')' || base == '*' || base == '+' ||
+ base == '?' || base == '[' || base == ']' || base == '\\' ||
+ base == '$' || base == '^' || base == '|') {
+ escaped = '\\' + base;
+ }
+ var lo = String.fromCharCode(i + 0x20);
+ base_result = new RegExp('(' + escaped + ')\\1', 'i').exec(base + base);
+ assertEquals( base_result, [base + base, base]);
+ lo_result = new RegExp('(' + escaped + ')\\1', 'i').exec(base + lo);
+ if (base.toLowerCase() == lo) {
+ assertEquals([base + lo, base], lo_result);
+ total_lo++;
+ } else {
+ assertEquals(null, lo_result);
+ }
+}
+// Should have hit the branch for the following char codes:
+// [A-Z], [192-222] but not 215
+assertEquals((90-65+1)+(222-192-1+1), total_lo);
« src/string-search.h ('K') | « test/mjsunit/regexp-capture-3.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698