"Fossies" - the Fresh Open Source Software Archive

Member "libwww-perl-6.43/t/local/autoload-get.t" (26 Nov 2019, 575 Bytes) of package /linux/www/libwww-perl-6.43.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 use strict;
    2 use warnings;
    3 use Test::More;
    4 
    5 use LWP::UserAgent;
    6 use URI;
    7 
    8 plan tests => 4;
    9 
   10 #
   11 # See if autoloading of protocol schemes work
   12 #
   13 # note no LWP::Protocol::file;
   14 
   15 my $url = "file:.";
   16 is(URI->new($url)->file, '.', 'URI of file:. is .');
   17 
   18 my $ua = LWP::UserAgent->new;
   19 
   20 $ua->timeout(30);
   21 is($ua->timeout(), 30, 'timeout: set to 30 seconds');
   22 
   23 my $response = $ua->get($url);
   24 isa_ok($response, 'HTTP::Response', 'Got a proper response');
   25 
   26 ok( $response->is_success(), 'Response was successful' );
   27 unless($response->is_success()) {
   28     print $response->error_as_HTML;
   29 }