diff options
author | Chad Austin <chad@imvu.com> | 2013-04-15 21:15:13 -0700 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-18 20:08:14 +0300 |
commit | e53dd06bf9ca763a65f8bc77dd3ae980843e8652 (patch) | |
tree | 14571b59144cf67562a2e2989031bd80ce33b057 /tests | |
parent | 181e6abb2f3abb9c3dc07d769adb84f6bc5982bc (diff) |
allow passing Int8Array and Uint8Array directly to std::string
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/embind/embind.test.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js index 6473573a..821355d2 100755 --- a/tests/embind/embind.test.js +++ b/tests/embind/embind.test.js @@ -409,6 +409,16 @@ module({ }); }); + test("can pass Uint8Array to std::string", function() { + var e = cm.emval_test_take_and_return_std_string(new Uint8Array([65, 66, 67, 68])); + assert.equal('ABCD', e); + }); + + test("can pass Int8Array to std::string", function() { + var e = cm.emval_test_take_and_return_std_string(new Int8Array([65, 66, 67, 68])); + assert.equal('ABCD', e); + }); + test("non-ascii wstrings", function() { var expected = String.fromCharCode(10) + String.fromCharCode(1234) + |