use super::*;
#[test]
fn a_sited_error_keeps_its_kind_and_names_the_step_and_the_path() {
let bare = io::Error::new(io::ErrorKind::NotFound, "No such file or directory");
let err = sited(
"read the landing schedule",
Path::new("/home/u/w"),
Err::<(), _>(bare),
)
.expect_err("the error survives");
assert_eq!(err.kind(), io::ErrorKind::NotFound, "matchable as before");
assert_eq!(
err.to_string(),
"read the landing schedule (/home/u/w): No such file or directory"
);
}
#[test]
fn a_sited_success_is_the_value_itself() {
assert_eq!(
sited("read the landing schedule", Path::new("/home/u/w"), Ok(7)).expect("ok"),
7
);
}
#[test]
fn every_report_arm_is_quiet_about_the_verb() {
report(Ok(true));
report(Ok(false));
report(Err(io::Error::other("boom")));
}