1

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?

Artem
  • 517
  • 1
  • 7
  • 24

1 Answers1

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