File: autoload.t

package info (click to toggle)
libwww-perl 5.47-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 692 kB
  • ctags: 345
  • sloc: perl: 5,458; makefile: 37; sh: 6
file content (27 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (2)
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
#
# See if autoloading of protocol schemes work
#

print "1..1\n";

require LWP::UserAgent;
# note no LWP::Protocol::file;

$url = "file:.";

require URI;
print "Trying to fetch '" . URI->new($url)->file . "'\n";

my $ua = new LWP::UserAgent;    # create a useragent to test
$ua->timeout(30);               # timeout in seconds

my $request = HTTP::Request->new(GET => $url);

my $response = $ua->request($request);
if ($response->is_success) {
    print "ok 1\n";
    print $response->as_string;
} else {
    print "not ok 1\n";
    print $response->error_as_HTML;
}