#![cfg(windows)]
use nova_runtime::signal::{console_handler, nova_rt_shutdown_requested};
#[test]
fn ctrl_c_sets_the_flag_and_a_later_event_falls_through() {
assert_eq!(
nova_rt_shutdown_requested(),
0,
"the first read installs the handler and finds the flag clear"
);
assert_eq!(
console_handler(0),
1,
"CTRL_C_EVENT is handled the first time"
);
assert_eq!(nova_rt_shutdown_requested(), 1, "and it set the flag");
assert_eq!(
console_handler(1),
0,
"CTRL_BREAK_EVENT with the flag already set falls through to the default action"
);
assert_eq!(
console_handler(2),
0,
"CTRL_CLOSE_EVENT always falls through"
);
}