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

Unified Diff: test/mjsunit/substr.js

Issue 7477045: Tentative implementation of string slices (hidden under the flag --string-slices). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some more suggested changes. Created 9 years, 4 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/ia32/code-stubs-ia32.cc ('K') | « test/mjsunit/string-slices-regexp.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/substr.js
diff --git a/test/mjsunit/substr.js b/test/mjsunit/substr.js
index f69a9c045c9aaec793ebb71ea162f9244accd05c..cffaf94da2650eb4322a3d63c289c2e7c214e26c 100755
--- a/test/mjsunit/substr.js
+++ b/test/mjsunit/substr.js
@@ -135,3 +135,20 @@ for (var i = 0; i < 10000; i++) {
assertEquals(xl - (i % xl), z.length);
cache.push(z);
}
+
+// Substring of substring.
+var cache = [];
+var last = x;
+var offset = 0;
+for (var i = 0; i < 64; i++) {
+ var z = last.substring(i);
+ last = z;
+ cache.push(z);
+ offset += i;
+}
+for (var i = 63; i >= 0; i--) {
+ var z = cache.pop();
+ assertTrue(/\u2028123456789ABCDEF/.test(z));
+ assertEquals(xl - offset, z.length);
+ offset -= i;
+}
« src/ia32/code-stubs-ia32.cc ('K') | « test/mjsunit/string-slices-regexp.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698