~ubuntu-branches/ubuntu/oneiric/libwww-perl/oneiric

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!perl -w

use Test;

use strict;
use File::Listing;
use LWP::Simple;

# some sample URLs
my @urls = (
	    "http://www.apache.org/dist/apr/?C=N&O=D",
	    "http://perl.apache.org/rpm/distrib/",
	    "http://www.cpan.org/modules/by-module/",
	   );
plan tests => scalar(@urls);

for my $url (@urls) {
    print "# $url\n";
    my $dir = get($url);
    unless ($dir) {
	print "# Can't get document at $url\n";
	ok(0);
	next;
    }
    my @listing = parse_dir($dir, undef, "apache");
    ok(@listing);
}