"Fossies" - the Fresh Open Source Software Archive

Member "libwww-perl-6.43/t/base/protocols.t" (26 Nov 2019, 707 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 plan tests => 7;
    7 
    8 my $ua = LWP::UserAgent->new();
    9 
   10 $ua->protocols_forbidden(['hTtP']);
   11 is(scalar(@{$ua->protocols_forbidden()}), 1,'$ua->protocols_forbidden');
   12 is($ua->protocols_forbidden()->[0], 'hTtP', '$ua->protocols_forbidden->[0]');
   13 
   14 my $response = $ua->get('http://www.cpan.org/');
   15 isa_ok($response, 'HTTP::Response', 'Proper response object');
   16 ok($response->is_error(), '$response->is_error');
   17 
   18 ok(!$ua->is_protocol_supported('http'), '! $ua->is_protocol_supported("http")');
   19 ok(!$ua->protocols_allowed(), '! $ua->protocols_allowed');
   20 
   21 $ua->protocols_forbidden(undef);
   22 ok(!$ua->protocols_forbidden(), '$ua->protocols_forbidden(undef)');