From 333644a410eed975edb1641bd313444e6e476af3 Mon Sep 17 00:00:00 2001 From: chansuke Date: Sat, 10 Aug 2019 19:17:35 +0900 Subject: [PATCH] Show error message if panic doesn't occur in should_panic --- src/libtest/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 53bf67bdf671f..c38fd0d9dd58d 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -1523,6 +1523,7 @@ fn __rust_begin_short_backtrace(f: F) { fn calc_result(desc: &TestDesc, task_result: Result<(), Box>) -> 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::() @@ -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