diff --git a/tests/jerry/string-prototype-charat.js b/tests/jerry/string-prototype-charat.js index 25f06da52..92d0c71ee 100644 --- a/tests/jerry/string-prototype-charat.js +++ b/tests/jerry/string-prototype-charat.js @@ -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) === ""); diff --git a/tests/jerry/string-prototype-charcodeat.js b/tests/jerry/string-prototype-charcodeat.js index 97fc80786..8e10ff262 100644 --- a/tests/jerry/string-prototype-charcodeat.js +++ b/tests/jerry/string-prototype-charcodeat.js @@ -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))); diff --git a/tests/jerry/string-prototype-concat.js b/tests/jerry/string-prototype-concat.js index 7a890f844..4eb117bf3 100644 --- a/tests/jerry/string-prototype-concat.js +++ b/tests/jerry/string-prototype-concat.js @@ -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");