Index: test/mjsunit/string-charat.js |
diff --git a/test/mjsunit/string-charat.js b/test/mjsunit/string-charat.js |
index 8ec8f1e08f5b3b7c40ecffaabac410f45b9db378..d1989dfd731177e50c4bd3dcbdd585995901b16e 100644 |
--- a/test/mjsunit/string-charat.js |
+++ b/test/mjsunit/string-charat.js |
@@ -51,3 +51,16 @@ assertEquals(116, s.charCodeAt(NaN)); |
assertTrue(isNaN(s.charCodeAt(-1))); |
assertTrue(isNaN(s.charCodeAt(4))); |
+// Make sure enough of the one-char string cache is filled. |
+var alpha = ['@']; |
+for (var i = 1; i < 128; i++) { |
+ var c = String.fromCharCode(i); |
+ alpha[i] = c.charAt(0); |
+} |
+var alphaStr = alpha.join(""); |
+ |
+// Now test chars. |
+for (var i = 1; i < 128; i++) { |
+ assertEquals(alpha[i], alphaStr.charAt(i)); |
+ assertEquals(String.fromCharCode(i), alphaStr.charAt(i)); |
+} |