Lines
100 %
Functions
Branches
use super::*;
#[test]
fn the_fiber_cap_is_a_resource_stop() {
let capped = wasmtime::Error::msg("store limit of fibers has been reached");
assert_eq!(classify_runtime_error(&capped), EngineError::FiberLimit);
let wrapped = capped.context("error while executing at wasm backtrace");
assert_eq!(classify_runtime_error(&wrapped), EngineError::FiberLimit);
}
fn a_host_condition_with_the_fiber_text_stays_a_host_condition() {
let condition = HostCondition {
code: "boom".to_string(),
message: "store limit of fibers has been reached".to_string(),
detail: None,
};
assert_eq!(
classify_runtime_error(&wasmtime::Error::new(condition)),
EngineError::ScriptRaised {
code: "BOOM".to_string(),
);
fn other_messages_stay_traps() {
let other = wasmtime::Error::msg("unreachable");
classify_runtime_error(&other),
EngineError::Trap("unreachable".to_string())
fn the_fiber_cap_maps_to_a_runtime_code() {
err_code_and_message(&EngineError::FiberLimit),
("runtime".to_string(), "fiber limit reached".to_string())