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

Function assert_trap

tests/all/traps.rs:614–619  ·  view source on GitHub ↗
(t: Error)

Source from the content-addressed store, hash-verified

612 return Ok(());
613
614 fn assert_trap(t: Error) {
615 println!("{t:?}");
616 let trace = t.downcast_ref::<WasmBacktrace>().unwrap().frames();
617 assert_eq!(trace.len(), 1);
618 assert_eq!(trace[0].func_index(), 0);
619 }
620}
621
622fn assert_trap_code(wat: &str, code: wasmtime::Trap) {

Callers 2

Calls 2

framesMethod · 0.45
unwrapMethod · 0.45

Tested by 2