Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
23
third-party/vendor/wasm-bindgen/tests/wasm/struct_vecs.js
vendored
Normal file
23
third-party/vendor/wasm-bindgen/tests/wasm/struct_vecs.js
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
const wasm = require('wasm-bindgen-test.js');
|
||||
const assert = require('assert');
|
||||
|
||||
exports.pass_struct_vec = () => {
|
||||
const el1 = new wasm.ArrayElement();
|
||||
const el2 = new wasm.ArrayElement();
|
||||
const ret = wasm.consume_struct_vec([el1, el2]);
|
||||
assert.strictEqual(ret.length, 3);
|
||||
|
||||
const ret2 = wasm.consume_optional_struct_vec(ret);
|
||||
assert.strictEqual(ret2.length, 4);
|
||||
|
||||
assert.strictEqual(wasm.consume_optional_struct_vec(undefined), undefined);
|
||||
};
|
||||
|
||||
exports.pass_invalid_struct_vec = () => {
|
||||
try {
|
||||
wasm.consume_struct_vec(['not a struct']);
|
||||
} catch (e) {
|
||||
assert.match(e.message, /array contains a value of the wrong type/)
|
||||
assert.match(e.stack, /consume_struct_vec/)
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue