()
| 367 | |
| 368 | #[test] |
| 369 | fn trap_start_function_import() -> Result<()> { |
| 370 | let mut store = Store::<()>::default(); |
| 371 | let binary = wat::parse_str( |
| 372 | r#" |
| 373 | (module $a |
| 374 | (import "" "" (func $foo)) |
| 375 | (start $foo) |
| 376 | ) |
| 377 | "#, |
| 378 | )?; |
| 379 | |
| 380 | let module = Module::new(store.engine(), &binary)?; |
| 381 | let sig = FuncType::new(store.engine(), None, None); |
| 382 | let func = Func::new(&mut store, sig, |_, _, _| bail!("user trap")); |
| 383 | let err = Instance::new(&mut store, &module, &[func.into()]).unwrap_err(); |
| 384 | err.assert_contains("user trap"); |
| 385 | Ok(()) |
| 386 | } |
| 387 | |
| 388 | #[test] |
| 389 | fn rust_panic_import() -> Result<()> { |
nothing calls this directly
no test coverage detected