We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d056b9 commit d0d56abCopy full SHA for d0d56ab
1 file changed
t/find_input.t
@@ -2,8 +2,9 @@
2
3
use strict;
4
use warnings;
5
-use Test::More tests => 7;
6
-use HTML::Form;
+use Test::More;
+use HTML::Form ();
7
+use Test::Warnings qw(warning);
8
9
my $html = '<html><body><form></form></body></html>';
10
@@ -29,13 +30,13 @@ ok(
29
30
like( $@, qr/Invalid index a/, 'exception text' );
31
32
{
- my @warnings;
33
- local $SIG{__WARN__} = sub { push @warnings, shift };
34
- my @inputs = $form->find_input( 'submit', 'input', 1 );
35
- is( scalar @warnings, 1, 'warns' );
36
- is(
37
- $warnings[0],
38
- "find_input called in list context with index specified\n",
+ like(
+ warning {
+ my @inputs = $form->find_input( 'submit', 'input', 1 );
+ },
+ qr/^find_input called in list context with index specified/,
39
'warning text'
40
);
41
}
+
42
+done_testing;
0 commit comments