Index: test/mjsunit/string-natives.js |
diff --git a/test/mjsunit/string-natives.js b/test/mjsunit/string-natives.js |
index b1ec875420cc094b2ede2310b1bcfd4ea4533648..cd1cde1fd79c5d60a829acb5ea1e3ff8d48234f5 100644 |
--- a/test/mjsunit/string-natives.js |
+++ b/test/mjsunit/string-natives.js |
@@ -29,15 +29,23 @@ |
function test() { |
var s1 = %NewString(26, true); |
+ for (i = 0; i < 26; i++) %_OneByteSeqStringSetChar(s1, i, 65); |
+ assertEquals("AAAAAAAAAAAAAAAAAAAAAAAAAA", s1); |
+ %_OneByteSeqStringSetChar(s1, 25, 66); |
+ assertEquals("AAAAAAAAAAAAAAAAAAAAAAAAAB", s1); |
for (i = 0; i < 26; i++) %_OneByteSeqStringSetChar(s1, i, i+65); |
assertEquals("ABCDEFGHIJKLMNOPQRSTUVWXYZ", s1); |
s1 = %TruncateString(s1, 13); |
assertEquals("ABCDEFGHIJKLM", s1); |
var s2 = %NewString(26, false); |
+ for (i = 0; i < 26; i++) %_TwoByteSeqStringSetChar(s2, i, 65); |
+ assertEquals("AAAAAAAAAAAAAAAAAAAAAAAAAA", s2); |
+ %_TwoByteSeqStringSetChar(s2, 25, 66); |
+ assertEquals("AAAAAAAAAAAAAAAAAAAAAAAAAB", s2); |
Yang
2013/11/06 09:55:09
Please also add a test that tests non-latin1 chara
Benedikt Meurer
2013/11/06 10:06:36
That's done below with s3 already.
|
for (i = 0; i < 26; i++) %_TwoByteSeqStringSetChar(s2, i, i+65); |
assertEquals("ABCDEFGHIJKLMNOPQRSTUVWXYZ", s2); |
- s2 = %TruncateString(s1, 13); |
+ s2 = %TruncateString(s2, 13); |
assertEquals("ABCDEFGHIJKLM", s2); |
var s3 = %NewString(26, false); |