blob: 9f0a3ea1225bf0e6a412fdfb0e109cb808dd7346 (
plain) (
blame)
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
|
# Testing the "Transfer truncated: only ... out of .. bytes received"
# case.
use strict;
use Test::More;
use File::Temp qw(tempfile);
use Getopt::Long qw(GetOptions);
use LWPx::ParanoidAgent;
my $url;
GetOptions("url=s" => \$url)
or die "usage: $0 [-url url]";
if (!$url) {
plan skip_all => 'Mirror tests needs -url option';
exit;
}
plan tests => 1;
my(undef, $tempfile) = tempfile(UNLINK => 1);
unlink $tempfile; # we only need the filename
my $ua = LWPx::ParanoidAgent->new;
my $resp = $ua->mirror($url, $tempfile);
ok($resp->is_success)
or diag($resp->as_string);
|