Skip to content

Commit

Permalink
Show error message if panic doesn't occur in should_panic
Browse files Browse the repository at this point in the history
  • Loading branch information
chansuke committed Aug 10, 2019
1 parent 605ea9d commit 333644a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libtest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,7 @@ fn __rust_begin_short_backtrace<F: FnOnce()>(f: F) {
fn calc_result(desc: &TestDesc, task_result: Result<(), Box<dyn Any + Send>>) -> TestResult {
match (&desc.should_panic, task_result) {
(&ShouldPanic::No, Ok(())) | (&ShouldPanic::Yes, Err(_)) => TrOk,
(&ShouldPanic::Yes, Ok(())) => TrFailedMsg("test did not panic as expected".to_string()),
(&ShouldPanic::YesWithMessage(msg), Err(ref err)) => {
if err
.downcast_ref::<String>()
Expand Down Expand Up @@ -1561,6 +1562,7 @@ impl MetricMap {
///
/// If `noise` is positive, then it means this metric is of a value
/// you want to see grow smaller, so a change larger than `noise` in the

/// positive direction represents a regression.
///
/// If `noise` is negative, then it means this metric is of a value
Expand Down

0 comments on commit 333644a

Please sign in to comment.