report_fails

Function report_fails 

Source
pub fn report_fails<I: Debug, E: Debug, R: Debug>(fails: Vec<(I, E, R, usize)>)
Expand description

Constructs a pretty print report of all failed assertions.

  • This method does not check for plausible input!
  • Panics if fails.is_empty() == false.

ยงUsage

Usually used in combination with collect_fails

Basic usage:


report_fails(vec![
    ("input string", "expected string", "", 1),
    ("hello world!", "hello papa!", "hello mom!", 2),
])

// One or more assertions failed:
// test case 1: assertion failed for input `"input string"`
//         expected `"expected string"`
//         result `""`
// test case 2: assertion failed for input `"hello world!"`
//         expected `"hello papa!"`