diff --git a/lib/loader/tests/index.js b/lib/loader/tests/index.js index 2808a24b0e..e9ead9d13e 100644 --- a/lib/loader/tests/index.js +++ b/lib/loader/tests/index.js @@ -59,6 +59,22 @@ function test(file) { assert.strictEqual(exports.strlen(ref), str.length); } + // should be able to allocate and work with a string containing an isolated high surrogate + { + let str = "𝄞".substring(0, 1); + let ref = exports.__newString(str); + assert.strictEqual(exports.__getString(ref), str); + assert.strictEqual(exports.strlen(ref), str.length); + } + + // should be able to allocate and work with a string containing an isolated low surrogate + { + let str = "𝄞".substring(1); + let ref = exports.__newString(str); + assert.strictEqual(exports.__getString(ref), str); + assert.strictEqual(exports.strlen(ref), str.length); + } + // should be able to allocate a typed array { let arr = [1, 2, 3, 4, 5, 0x80000000 | 0];