File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use strict;
4
4
use warnings;
5
- use Test::More tests => 7;
6
- use HTML::Form;
5
+ use Test::More;
6
+ use HTML::Form ();
7
+ use Test::Warnings qw( warning) ;
7
8
8
9
my $html = ' <html><body><form></form></body></html>' ;
9
10
29
30
like( $@ , qr / Invalid index a/ , ' exception text' );
30
31
31
32
{
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 " ,
33
+ like(
34
+ warning {
35
+ my @inputs = $form -> find_input( ' submit' , ' input' , 1 );
36
+ },
37
+ qr / ^find_input called in list context with index specified/ ,
39
38
' warning text'
40
39
);
41
40
}
41
+
42
+ done_testing;
You can’t perform that action at this time.
0 commit comments