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

Function new

crates/core/tests/tests.rs:84–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82
83#[test]
84fn new() {
85 let mut error = Error::new(TestError(42));
86 assert!(error.is::<TestError>());
87 assert_eq!(error.downcast_ref::<TestError>().unwrap().0, 42);
88 error.downcast_mut::<TestError>().unwrap().0 += 1;
89 assert_eq!(error.downcast_ref::<TestError>().unwrap().0, 43);
90}
91
92#[test]
93fn new_drops() {

Callers 15

new_dropsFunction · 0.70
msg_dropsFunction · 0.70
into_boxed_dyn_errorFunction · 0.70
isFunction · 0.70
backtraceFunction · 0.70
downcastFunction · 0.70
downcast_refFunction · 0.70
downcast_mutFunction · 0.70
context_on_oomFunction · 0.70

Calls 2

TestErrorClass · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected