use super::*;
const HANGUP_PROBE: &str = "ARTIFACTIZE_TEST_TERMINAL_HANGUP";
#[test]
fn terminal_hangup_completes_the_portable_stop_future() {
let mut child = crate::test_os::test_command(
"platform::unix::tests::terminal_hangup_probe",
&[(HANGUP_PROBE, "1".into())],
);
let output = crate::test_os::finish(crate::test_os::start(&mut child), "terminal hangup probe");
assert!(output.status.success(), "{output:?}");
}
#[tokio::test]
async fn terminal_hangup_probe() {
if std::env::var_os(HANGUP_PROBE).is_none() {
return;
}
let stop = stop_requested().unwrap();
crate::test_os::hangup_self();
stop.await;
}
#[test]
fn transient_file_access_is_always_false() {
assert!(!transient_file_access(&io::Error::from_raw_os_error(5)));
assert!(!transient_file_access(&io::Error::new(
io::ErrorKind::PermissionDenied,
"permission denied"
)));
}