1121: Add test for ImportObject's `allow_missing_functions` r=Hywan a=MarkMcCaskey

work in progress, testing to see if this test fails CI

resolves #1118 

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
This commit is contained in:
bors[bot] 2020-01-10 10:16:32 +00:00 committed by GitHub
commit 50f3079d82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,24 @@
#[test]
fn allow_missing() {
use wabt::wat2wasm;
use wasmer_runtime::{imports, instantiate};
static WAT: &'static str = r#"
(module
(type (;0;) (func))
(type (;1;) (func (result i32)))
(import "env" "ret_err" (func $ret_err (type 0)))
(func $get_num (type 1)
i32.const 42
)
(export "get_num" (func $get_num))
)
"#;
let wasm = wat2wasm(WAT).unwrap();
let mut import_object = imports! {};
import_object.allow_missing_functions = true;
assert!(instantiate(&wasm, &import_object).is_ok());
}