mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 16:20:49 +00:00
Merge #1121
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:
commit
50f3079d82
24
lib/runtime/tests/allow_missing_functions.rs
Normal file
24
lib/runtime/tests/allow_missing_functions.rs
Normal 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());
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user