use super::*;
#[test]
fn retryable_infra_categories_exit_with_ex_tempfail() {
assert_eq!(exec_failure_exit_code(Some("network")), 75);
assert_eq!(exec_failure_exit_code(Some("timeout")), 75);
assert_eq!(EXEC_EXIT_RETRYABLE_INFRA, 75, "EX_TEMPFAIL from sysexits.h");
}
#[test]
fn genuine_failures_keep_exit_1() {
assert_eq!(exec_failure_exit_code(Some("tool")), 1);
assert_eq!(exec_failure_exit_code(Some("authentication")), 1);
assert_eq!(exec_failure_exit_code(Some("invalid_input")), 1);
assert_eq!(exec_failure_exit_code(None), 1);
assert_eq!(exec_failure_exit_code(Some("rate_limit")), 1);
}
#[test]
fn recoverable_error_events_do_not_fail_the_run_summary() {
let warning = crate::error_taxonomy::ErrorEnvelope::network(
"Stream stalled: no data received for 120s, closing stream",
);
assert!(
!exec_error_event_is_fatal(&warning),
"recoverable envelopes must not poison the exec summary"
);
let fatal = crate::error_taxonomy::ErrorEnvelope::fatal("engine exploded");
assert!(exec_error_event_is_fatal(&fatal));
}