MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / start_trap_pretty

Function start_trap_pretty

tests/all/traps.rs:568–597  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

566
567#[test]
568fn 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 "\
588error 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]
600fn present_after_module_drop() -> Result<()> {

Callers

nothing calls this directly

Calls 4

OkFunction · 0.85
assert_containsMethod · 0.80
newFunction · 0.50
engineMethod · 0.45

Tested by

no test coverage detected