You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
388 B
14 lines
388 B
5 years ago
|
use anyhow::Result;
|
||
|
use wasmtime::*;
|
||
|
|
||
|
#[test]
|
||
|
fn wrong_import_numbers() -> Result<()> {
|
||
|
let store = Store::default();
|
||
|
let module = Module::new(&store, r#"(module (import "" "" (func)))"#)?;
|
||
|
|
||
|
assert!(Instance::new(&module, &[]).is_err());
|
||
|
let func = Func::wrap(&store, || {});
|
||
|
assert!(Instance::new(&module, &[func.clone().into(), func.into()]).is_err());
|
||
|
Ok(())
|
||
|
}
|