mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-15 04:23:12 +03:00
24 lines
644 B
JavaScript
24 lines
644 B
JavaScript
|
const wasm = require('wasm-bindgen-test.js');
|
||
|
|
||
|
function assertEq(a, b) {
|
||
|
console.log(a, '?=', b);
|
||
|
if (a === b)
|
||
|
return;
|
||
|
throw new Error('not equal');
|
||
|
}
|
||
|
|
||
|
exports.char_works = function() {
|
||
|
assertEq(wasm.char_single_char(), 'a');
|
||
|
assertEq(wasm.char_wide_char(), '💩');
|
||
|
assertEq(wasm.char_parrot('Ղ'), 'Ղ');
|
||
|
assertEq(wasm.char_parrot('ҝ'), 'ҝ');
|
||
|
assertEq(wasm.char_parrot('Δ'), 'Δ');
|
||
|
assertEq(wasm.char_parrot('䉨'), '䉨');
|
||
|
assertEq(wasm.char_round('a'), 'a');
|
||
|
assertEq(wasm.char_round('㊻'), '㊻');
|
||
|
wasm.char_short_test('a');
|
||
|
wasm.char_wide_test('💩');
|
||
|
};
|
||
|
|
||
|
exports.js_parrot = function(a) { return a; };
|