Report span of test when should_panic test failed
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
parent
6e83046233
commit
c73598f0fb
5 changed files with 108 additions and 2 deletions
|
|
@ -77,7 +77,12 @@ pub(crate) fn calc_result(
|
|||
|
||||
// The test should have panicked, but didn't panic.
|
||||
(ShouldPanic::Yes, None) | (ShouldPanic::YesWithMessage(_), None) => {
|
||||
TestResult::TrFailedMsg("test did not panic as expected".to_string())
|
||||
let fn_location = if !desc.source_file.is_empty() {
|
||||
&format!(" at {}:{}:{}", desc.source_file, desc.start_line, desc.start_col)
|
||||
} else {
|
||||
""
|
||||
};
|
||||
TestResult::TrFailedMsg(format!("test did not panic as expected{}", fn_location))
|
||||
}
|
||||
|
||||
// The test should not have panicked, but did panic.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue