use super::*;
#[test]
fn only_a_commit_target_names_a_commit() {
assert!(names_commit(&Base::Commit("a".repeat(40))));
assert!(!names_commit(&Base::Unborn));
}
#[test]
fn each_failure_is_worded_by_its_cause() {
assert_eq!(LandingError::Git(GitFailure(String::from("git broke"))).to_string(), "git broke");
assert_eq!(LandingError::Recovery(RecoveryError(String::from("recovery broke"))).to_string(), "recovery broke");
assert_eq!(LandingError::Journal(String::from("journal broke")).to_string(), "journal broke");
assert_eq!(LandingError::Release(String::from("release broke")).to_string(), "release broke");
assert_eq!(
LandingError::Phase(PhaseMarkerError::Io(std::io::Error::other("disk"))).to_string(),
"transaction phase marker failed: disk"
);
assert!(
LandingError::Lock(CoordinationFailure::Stop(String::from("lock broke")))
.to_string()
.contains("lock broke")
);
}