Sometimes, test are not as simple as calling assert_eq. Sometimes you want to do lots of assertions inside the test
function:
#[test]
pub fn product_test() {
fn test(
operands: &[u64],
expected_result: &[u64],
) {
//assert lots of stuff here
}
test(
&[0],
&[0],
);
test(
&[1,4],
&[7,8,9],
);
test(
&[1,2,3],
&[6,7],
);
however, when it fails, I don't know which of the 3 tests above failed. It's hard to look at the backtrace. On a simple assert_eq!, I'd see which line.
Is there a way for knowing which of these 3 tests failed without looking at the backtrace?