Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import of PETDANCE/WWW-Mechanize-1.29_01 from CPAN.
gitpan-cpan-distribution: WWW-Mechanize gitpan-cpan-version: 1.29_01 gitpan-cpan-path: PETDANCE/WWW-Mechanize-1.29_01.tar.gz gitpan-cpan-author: PETDANCE gitpan-cpan-maturity: developer
- Loading branch information
Showing
8 changed files
with
119 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!perl -T | ||
|
||
use warnings; | ||
use strict; | ||
|
||
use constant LANGUAGES => qw( en it ja es nl pl ); | ||
use Test::More tests => 3 + (2 * scalar LANGUAGES); | ||
|
||
BEGIN { | ||
use_ok( 'WWW::Mechanize' ); | ||
} | ||
|
||
my $mech = WWW::Mechanize->new; | ||
isa_ok( $mech, 'WWW::Mechanize', 'Created object' ); | ||
$mech->agent_alias( 'Windows IE 6' ); # Wikipedia 403s out obvious bots | ||
|
||
for my $lang ( LANGUAGES ) { | ||
my $start = "http://$lang.wikipedia.org/"; | ||
|
||
$mech->get( $start ); | ||
|
||
ok( $mech->success, "Got $start" ); | ||
my @links = $mech->links(); | ||
cmp_ok( scalar @links, '>', 50, "Over 50 links on $start" ); | ||
} | ||
|
||
SKIP: { | ||
eval "use Test::Memory::Cycle"; | ||
skip "Test::Memory::Cycle not installed", 1 if $@; | ||
|
||
memory_cycle_ok( $mech, "No memory cycles found" ); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# vi: ft=perl | ||
# Thanks to merlyn for nudging me and giving me this snippet! | ||
use strict; | ||
use HTTP::Daemon; | ||
|