X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=t%2F007broken_links.t;h=93148f4d4e01949476f18f3755e444958c40a421;hb=93d494952f69bfad31e5d887b57609cbf8e41d43;hp=f0162eba18c88a8612fa6624c42d4df2ca0e734b;hpb=58640fb9e668911ee9625eae9923e1795f1b8082;p=kivitendo-erp.git diff --git a/t/007broken_links.t b/t/007broken_links.t index f0162eba1..93148f4d4 100644 --- a/t/007broken_links.t +++ b/t/007broken_links.t @@ -1,10 +1,20 @@ #!/usr/bin/perl +# adapted from Michael Stevens' test script posted in p5p +# in the thread "broken links in blead" from 01/19/2011 +# +# caveats: wikipedia seems to have crawler protection and +# will give 403 forbidden unless the user agent is faked. + use strict; use File::Find; -use LWP::Simple; -use Test::More tests => 1; -use URI::Find; +use Test::More; + +if (eval " use LWP::Simple; use URI::Find; 1 ") { + plan tests => 1; +} else { + plan skip_all => "LWP::Simple or URI::Find not installed"; +} my @fails; @@ -20,6 +30,7 @@ my $finder = URI::Find->new(sub { }); find(sub { + return unless -f $File::Find::name; open(FH, $File::Find::name) or return; my $text; { local $/; $text = ; }