Add ARM files
[dh-make-perl] / dev / arm / libwww-mechanize-perl / libwww-mechanize-perl-1.34 / t / live / wikipedia.t
1 #!perl -T
2
3 use warnings;
4 use strict;
5
6 if ($ENV{NOINTERNET} ) {
7    use Test::More skip_all => "We don't have internet here";
8 }
9
10
11 use constant LANGUAGES => qw( en it ja es nl pl );
12 use Test::More tests => 3 + (2 * scalar LANGUAGES);
13
14 BEGIN {
15     use_ok( 'WWW::Mechanize' );
16 }
17
18 my $mech = WWW::Mechanize->new;
19 isa_ok( $mech, 'WWW::Mechanize', 'Created object' );
20 $mech->agent_alias( 'Windows IE 6' ); # Wikipedia 403s out obvious bots
21
22 for my $lang ( LANGUAGES ) {
23     my $start = "http://$lang.wikipedia.org/";
24
25     $mech->get( $start );
26
27     ok( $mech->success, "Got $start" );
28     my @links = $mech->links();
29     cmp_ok( scalar @links, '>', 50, "Over 50 links on $start" );
30 }
31
32 SKIP: {
33     eval 'use Test::Memory::Cycle';
34     skip 'Test::Memory::Cycle not installed', 1 if $@;
35
36     memory_cycle_ok( $mech, 'No memory cycles found' );
37 }
38