This:
use strict; use warnings; use Test::Exception; use Test::Differences; use Test::Deep; use Test::Warn; use Test::More tests => ...;
shrinks down to
use Test::Most tests => ...;
It can't become any shorter ... :)
But I want to show you two other features:
use Test::Most die => tests => 25;
Notice the die? The execution of your tests will stop after the first failure. This is often sensible, because one failure often leads to serveral others. And what you still see on the screen is not the real problem. You can also induce this behaviour via the environment variable DIE_ON_FAIL.
The next feature is explain. Test::More has something similar ('note explain ...'), but I did not use it until I saw it in Test::Most. It prints a diagnostic message, with all references going through Data::Dumper:
my $res = $ua->get(...); explain 'Response: ', $res; ...
If you are using prove (which I recommend), you have to use the verbose switch (-v) to see it.
Links:
I didn't know about explain and die. They are nice enough that I think I'll try Test::Most out to replace Test::More et al. Thanks.
ReplyDelete