This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In test.pl, refactor the implementation of warning_{is,like} and warnings_like.
authorNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 14:09:47 +0000 (15:09 +0100)
committerNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 14:13:16 +0000 (15:13 +0100)
commit3fbaac97953bf3ca27149a4c9bd6c9893141d568
tree94ac5ede1a152489bba5bac3d2befb992dc57f82
parent3dfaac447d030f911d146c3ae56b9dba63ce9dd4
In test.pl, refactor the implementation of warning_{is,like} and warnings_like.

Break out the code to capture warnings from the code to analyse them. Implement
tests directly in warning_{is,like}, rather than implementing them as a call to
warning_like. Remove the C<use warnings "all">, as it is lexically scoped, and
won't apply to the scope of the subroutine being called.

Previously all 3 would erroneously pass if the expectation was for 1 warning,
there were more than 1 warnings, but the first warning matched the expected
warning.
t/test.pl