Lines
100 %
Functions
Branches
use super::*;
#[test]
fn a_thrown_condition_wins() {
let kept = prefer_thrown(
wasmtime::Error::new(wasmtime::ThrownException),
wasmtime::Error::msg("original"),
);
assert!(kept.is::<wasmtime::ThrownException>(), "{kept}");
}
fn a_trap_while_throwing_wins_over_the_condition() {
wasmtime::Error::new(wasmtime::Trap::OutOfFuel),
assert_eq!(
kept.downcast_ref::<wasmtime::Trap>(),
Some(&wasmtime::Trap::OutOfFuel)
fn a_build_failure_falls_back_to_the_condition() {
wasmtime::Error::msg("module does not export `nomi_error`"),
assert_eq!(kept.to_string(), "original");