Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对随机生成的数据进行了很多检查。如何仅针对失败的测试获取报告消息并且如果检查正常则不显示任何内容?
您可以使用fail例程。在任何 Test::More 代码之外进行检查,并使用该结果来决定是否输出测试消息。
fail
foreach my $element ( @randomly_generated_data ) { my $result = ...; # your checks here next if $result; fail( 'Some message' ); }