~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to test/mjsunit/string-slices.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
  f(flat, cons, slice, i);
161
161
}
162
162
 
 
163
// Short substrings.
 
164
flat = "abcdefghijkl12345";
 
165
cons = flat + flat.toUpperCase();
 
166
/x/.exec(cons);  // Flatten cons
 
167
slice = "abcdefghijklmn12345".slice(1, -1);
 
168
assertEquals("cdefg", flat.substr(2, 5));
 
169
assertEquals("cdefg", cons.substr(2, 5));
 
170
assertEquals("cdefg", slice.substr(1, 5));
 
171
 
 
172
flat = "abc\u1234defghijkl12345";
 
173
cons = flat + flat.toUpperCase();
 
174
/x/.exec(cons);  // Flatten cons
 
175
slice = "abc\u1234defghijklmn12345".slice(1, -1);
 
176
assertEquals("c\u1234def", flat.substr(2, 5));
 
177
assertEquals("c\u1234def", cons.substr(2, 5));
 
178
assertEquals("c\u1234def", slice.substr(1, 5));
 
179
 
163
180
// Concatenate substrings.
164
181
var ascii = 'abcdefghijklmnop';
165
182
var utf = '\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB';