Skip to content

Commit 7310a51

Browse files
committed
add test for failure reason
1 parent 1336e0b commit 7310a51

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/runner/test.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,3 +458,11 @@ fn is_library(target: &Target) -> bool {
458458
.iter()
459459
.all(|k| !["example", "test", "bench"].contains(&k.as_str()))
460460
}
461+
462+
463+
#[test]
464+
fn test_failure_reason() {
465+
let error : failure::Error = CommandError::IO(std::io::Error::other("Test")).into();
466+
assert_eq!(failure_reason(&error), FailureReason::Unknown);
467+
assert_eq!(failure_reason(&error.context(FailureReason::ICE).into()), FailureReason::ICE);
468+
}

0 commit comments

Comments
 (0)