Debian lenny version packages
[pkg-perl] / deb-src / libwww-perl / libwww-perl-5.813 / t / live / https.t
1 #!perl -w
2
3 use strict;
4 use LWP::UserAgent;
5
6 my $ua = LWP::UserAgent->new();
7 my $res = $ua->simple_request(HTTP::Request->new(GET => "https://www.sun.com"));
8
9 if ($res->code == 501 && $res->message =~ /Protocol scheme 'https' is not supported/) {
10     print "1..0 # Skipped: " . $res->message . "\n";
11     exit;
12 }
13
14 print "1..2\n";
15 print "not " unless $res->is_success;
16 print "ok 1\n";
17
18 print "not " unless $res->content =~ /Sun Microsystems/;
19 print "ok 2\n";
20
21 my $cref = $res->content_ref;
22 substr($$cref, 100) = "..." if length($$cref) > 100;
23 print "\n", $res->as_string;