Debian Codegraph @

t/head_ok-parms.t

raw symbols SCIP
1 #!perl -T
2
3 use strictscip-perl cpan Test-WWW-Mechanize 1.60 strict/;
4 use warningsscip-perl cpan Test-WWW-Mechanize 1.60 warnings/;
5
6 use Test::Morescip-perl cpan Test-WWW-Mechanize 1.60 Test/More/ tests => 15;
7 use Test::Builder::Testerscip-perl cpan Test-WWW-Mechanize 1.60 Test/Builder/Tester/;
8
9 use Test::WWW::Mechanizescip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/;
10
11 my $ua_args;
12
13 sub Test::WWW::Mechanize::successscip-perl cpan Test-WWW-Mechanize 1.60 main/`Test::WWW::Mechanize::success`(). { return 1; }
14 sub Test::WWW::Mechanize::headscip-perl cpan Test-WWW-Mechanize 1.60 main/`Test::WWW::Mechanize::head`(). {
15 my $self = shiftscip-perl cpan Test-WWW-Mechanize 1.60 main/shift().;
16 my $url = shiftscip-perl cpan Test-WWW-Mechanize 1.60 main/shift().;
17
18 diescip-perl cpan Test-WWW-Mechanize 1.60 main/die(). 'Odd number of args sent in' if @_scip-perl cpan Test-WWW-Mechanize 1.60 main/`@_`. % 2 != 0;
19
20 $ua_args = {@_scip-perl cpan Test-WWW-Mechanize 1.60 main/`@_`.};
21
22 return 1;
23 }
24
25 my $mech = Test::WWW::Mechanize->newscip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/new().();
26 isa_okscip-perl cpan Test-WWW-Mechanize 1.60 main/isa_ok().( $mech, 'Test::WWW::Mechanize' );
27
28 my $url = 'dummy://url';
29 $mech->head_okscip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/head_ok().( $url );
30 okscip-perl cpan Test-WWW-Mechanize 1.60 main/ok().( eq_hashscip-perl cpan Test-WWW-Mechanize 1.60 main/eq_hash().( {}, $ua_args ), 'passing URL only' );
31
32 $mech->head_okscip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/head_ok().( $url, 'Description' );
33 okscip-perl cpan Test-WWW-Mechanize 1.60 main/ok().( eq_hashscip-perl cpan Test-WWW-Mechanize 1.60 main/eq_hash().( {}, $ua_args ), 'Passing description' );
34
35 $mech->head_okscip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/head_ok().( $url, undef, 'Description' );
36 okscip-perl cpan Test-WWW-Mechanize 1.60 main/ok().( eq_hashscip-perl cpan Test-WWW-Mechanize 1.60 main/eq_hash().( {}, $ua_args ), 'Passing undef for hash' );
37
38 my $wanted = { foo=>1, bar=>2, baz=>3 };
39
40 $mech->head_okscip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/head_ok().( $url, [ %{$wanted} ] );
41 okscip-perl cpan Test-WWW-Mechanize 1.60 main/ok().( eq_hashscip-perl cpan Test-WWW-Mechanize 1.60 main/eq_hash().( $wanted, $ua_args ), 'Passing anonymous list for hash' );
42
43 $mech->head_okscip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/head_ok().( $url, [ %{$wanted} ], 'Description' );
44 okscip-perl cpan Test-WWW-Mechanize 1.60 main/ok().( eq_hashscip-perl cpan Test-WWW-Mechanize 1.60 main/eq_hash().( $wanted, $ua_args ), 'Passing anonymous list for hash' );
45
46 $mech->head_okscip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/head_ok().( $url, { %{$wanted} } );
47 okscip-perl cpan Test-WWW-Mechanize 1.60 main/ok().( eq_hashscip-perl cpan Test-WWW-Mechanize 1.60 main/eq_hash().( $wanted, $ua_args ), 'Passing anonymous array for hash' );
48
49 $mech->head_okscip-perl cpan Test-WWW-Mechanize 1.60 Test/WWW/Mechanize/head_ok().( $url, { %{$wanted} }, 'Description' );
50 okscip-perl cpan Test-WWW-Mechanize 1.60 main/ok().( eq_hashscip-perl cpan Test-WWW-Mechanize 1.60 main/eq_hash().( $wanted, $ua_args ), 'Passing anonymous array for hash' );
51
52 done_testingscip-perl cpan Test-WWW-Mechanize 1.60 main/done_testing(). ();