mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Fix failing interpreter tests
This commit is contained in:
parent
346868f78b
commit
ff0a50e31e
@ -17,7 +17,17 @@ fn interpret(wat: &str, name: &str, result: Option<&[u32]>) {
|
||||
assert!(status.success());
|
||||
let module = walrus::Module::from_file(output.path()).unwrap();
|
||||
let mut i = Interpreter::new(&module).unwrap();
|
||||
assert_eq!(i.interpret_descriptor(name, &module), result);
|
||||
let id = module
|
||||
.exports
|
||||
.iter()
|
||||
.filter(|e| e.name == name)
|
||||
.filter_map(|e| match e.item {
|
||||
walrus::ExportItem::Function(f) => Some(f),
|
||||
_ => None,
|
||||
})
|
||||
.next()
|
||||
.unwrap();
|
||||
assert_eq!(i.interpret_descriptor(id, &module), result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -30,7 +40,6 @@ fn smoke() {
|
||||
)
|
||||
"#;
|
||||
interpret(wat, "foo", Some(&[]));
|
||||
interpret(wat, "bar", None);
|
||||
|
||||
let wat = r#"
|
||||
(module
|
||||
|
Loading…
x
Reference in New Issue
Block a user