Unicode string builtin tests added.
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Evgeny Gavrin
parent
f8f7eb4251
commit
54ade8b29e
@@ -45,6 +45,15 @@ assert("hello world!".charAt(11) === "!");
|
||||
|
||||
assert("hello world!".charAt(12) === "");
|
||||
|
||||
// check unicode
|
||||
assert("hello\u000B\u000C\u0020\u00A0world!".charAt(8) === "\u00A0");
|
||||
|
||||
assert("hello\uD834\uDF06world!".charAt(6) === "\uDF06");
|
||||
|
||||
assert("hell\u006F\u006F w\u006F\u006Frld!".charAt(8) === "\u006F");
|
||||
|
||||
assert("\u00A9\u006F".charAt(2) === "");
|
||||
|
||||
// check negative
|
||||
assert("hello world!".charAt(-1) === "");
|
||||
|
||||
|
||||
@@ -44,6 +44,15 @@ assert("hello world!".charCodeAt(11) === 33);
|
||||
|
||||
assert(isNaN("hello world!".charCodeAt(12)));
|
||||
|
||||
// check unicode
|
||||
assert("hello\u000B\u000C\u0020\u00A0world!".charCodeAt(8) === 160);
|
||||
|
||||
assert("hello\uD834\uDF06world!".charCodeAt(6) === 57094);
|
||||
|
||||
assert("hell\u006F\u006F w\u006F\u006Frld!".charCodeAt(8) === 111);
|
||||
|
||||
assert(isNaN("\u00A9\u006F".charCodeAt(2)));
|
||||
|
||||
// check negative
|
||||
assert(isNaN("hello world!".charCodeAt(-1)));
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ assert("Hello ".concat(s1) === "Hello Hello ");
|
||||
|
||||
assert(s1.concat(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) === "Hello 012345678901234567890123456789");
|
||||
|
||||
assert("".concat() === "");
|
||||
|
||||
// check unicode
|
||||
assert("\u0041".concat("\u0041", "\u1041") === "\u0041\u0041\u1041");
|
||||
assert("\u0041\u1D306A".concat("\u0041", "\u1041") === "\u0041\u1D306A\u0041\u1041");
|
||||
|
||||
// check undefined
|
||||
var y;
|
||||
assert("Check ".concat(y) === "Check undefined");
|
||||
|
||||
Reference in New Issue
Block a user