Add ARM files
[dh-make-perl] / dev / arm / libwww-mechanize-perl / libwww-mechanize-perl-1.34 / t / live / wikipedia.t
diff --git a/dev/arm/libwww-mechanize-perl/libwww-mechanize-perl-1.34/t/live/wikipedia.t b/dev/arm/libwww-mechanize-perl/libwww-mechanize-perl-1.34/t/live/wikipedia.t
new file mode 100644 (file)
index 0000000..769057d
--- /dev/null
@@ -0,0 +1,38 @@
+#!perl -T
+
+use warnings;
+use strict;
+
+if ($ENV{NOINTERNET} ) {
+   use Test::More skip_all => "We don't have internet here";
+}
+
+
+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' );
+}
+