Index: test/mjsunit/string-slices.js |
diff --git a/test/mjsunit/string-slices.js b/test/mjsunit/string-slices.js |
index b0b05eca366b3a490be84b32c088b6a14aa7e11e..f629ca9b6162d1dc3b197eae4756b0da2a6fae31 100755 |
--- a/test/mjsunit/string-slices.js |
+++ b/test/mjsunit/string-slices.js |
@@ -72,7 +72,7 @@ for (var i = 0; i < 25; i++) { |
} |
/x/.exec(x); // Try to force a flatten. |
for (var i = 5; i < 25; i++) { |
- for (var j = 12; j < 25; j++) { |
+ for (var j = 0; j < 25; j++) { |
var z = x.substring(i, i+j); |
var w = Math.random() * 42; // Allocate something new in new-space. |
assertEquals(j, z.length); |
@@ -110,7 +110,7 @@ x += x; |
x += x; |
var xl = x.length; |
var cache = []; |
-for (var i = 0; i < 10000; i++) { |
+for (var i = 0; i < 1000; i++) { |
var z = x.substring(i % xl); |
assertEquals(xl - (i % xl), z.length); |
cache.push(z); |
@@ -129,7 +129,7 @@ x += x; |
x += x; |
var xl = x.length; |
var cache = []; |
-for (var i = 0; i < 10000; i++) { |
+for (var i = 0; i < 1000; i++) { |
var z = x.substring(i % xl); |
assertEquals(xl - (i % xl), z.length); |
cache.push(z); |
@@ -149,6 +149,7 @@ for (var i = 63; i >= 0; i--) { |
var z = cache.pop(); |
assertTrue(/\u2028123456789ABCDEF/.test(z)); |
assertEquals(xl - offset, z.length); |
+ assertEquals(x.charAt(i*(i+1)/2), z.charAt(0)); |
offset -= i; |
} |