aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-04-11 00:14:23 -0700
committerJukka Jylänki <jujjyl@gmail.com>2013-04-18 20:08:11 +0300
commit6ca9bffb114f206c13d9954be32d6b8034ce5eef (patch)
tree1bb5f27bfd1cc8adacf9e3b40ab08f32893de27f /tests
parent53c228a260b7a5e90e430860e130ed6006bd328a (diff)
assert if, when trying to convert JS string to std::string, the JS string has code units that do not fit in 8 bits
Diffstat (limited to 'tests')
-rwxr-xr-xtests/embind/embind.test.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js
index 6f63d543..fec7145a 100755
--- a/tests/embind/embind.test.js
+++ b/tests/embind/embind.test.js
@@ -397,6 +397,12 @@ module({
assert.equal(expected, cm.get_non_ascii_string());
});
+ test("passing non-8-bit strings from JS to std::string throws", function() {
+ assert.throws(cm.BindingError, function() {
+ cm.emval_test_take_and_return_std_string("\u1234");
+ });
+ });
+
test("non-ascii wstrings", function() {
var expected = String.fromCharCode(10) +
String.fromCharCode(1234) +