I have a lot of checks for random generated data. How can I get report message only for failed tests and show nothing if check is ok?
Asked
Active
Viewed 71 times
1 Answers
3
You can use the fail
routine. Make your checks outside of any Test::More code and use that result to decide if you output test messages.
foreach my $element ( @randomly_generated_data ) {
my $result = ...; # your checks here
next if $result;
fail( 'Some message' );
}

brian d foy
- 129,424
- 31
- 207
- 592