Debian lenny version packages
[pkg-perl] / deb-src / libwww-perl / libwww-perl-5.813 / t / local / autoload.t
1 #
2 # See if autoloading of protocol schemes work
3 #
4
5 print "1..1\n";
6
7 require LWP::UserAgent;
8 # note no LWP::Protocol::file;
9
10 $url = "file:.";
11
12 require URI;
13 print "Trying to fetch '" . URI->new($url)->file . "'\n";
14
15 my $ua = new LWP::UserAgent;    # create a useragent to test
16 $ua->timeout(30);               # timeout in seconds
17
18 my $request = HTTP::Request->new(GET => $url);
19
20 my $response = $ua->request($request);
21 if ($response->is_success) {
22     print "ok 1\n";
23     print $response->as_string;
24 }
25 else {
26     print "not ok 1\n";
27     print $response->error_as_HTML;
28 }