()
| 566 | |
| 567 | #[test] |
| 568 | fn start_trap_pretty() -> Result<()> { |
| 569 | let mut store = Store::<()>::default(); |
| 570 | let wat = r#" |
| 571 | (module $m |
| 572 | (func $die unreachable) |
| 573 | (func call $die) |
| 574 | (func $foo call 1) |
| 575 | (func $start call $foo) |
| 576 | (start $start) |
| 577 | ) |
| 578 | "#; |
| 579 | |
| 580 | let module = Module::new(store.engine(), wat)?; |
| 581 | let e = match Instance::new(&mut store, &module, &[]) { |
| 582 | Ok(_) => panic!("expected failure"), |
| 583 | Err(e) => e, |
| 584 | }; |
| 585 | |
| 586 | e.assert_contains( |
| 587 | "\ |
| 588 | error while executing at wasm backtrace: |
| 589 | 0: 0x1d - m!die |
| 590 | 1: 0x21 - m!<wasm function 1> |
| 591 | 2: 0x26 - m!foo |
| 592 | 3: 0x2b - m!start", |
| 593 | ); |
| 594 | |
| 595 | e.assert_contains("wasm trap: wasm `unreachable` instruction executed"); |
| 596 | Ok(()) |
| 597 | } |
| 598 | |
| 599 | #[test] |
| 600 | fn present_after_module_drop() -> Result<()> { |
nothing calls this directly
no test coverage detected