From 8efc06b29a7ab7b5dec1ef0ec60c9396fa748803 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Mon, 18 May 2009 12:04:39 +0200 Subject: apply patch by SREZIC rt #44569 --- t/30-mirror.t | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 t/30-mirror.t (limited to 't/30-mirror.t') diff --git a/t/30-mirror.t b/t/30-mirror.t new file mode 100644 index 0000000..9f0a3ea --- /dev/null +++ b/t/30-mirror.t @@ -0,0 +1,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); -- cgit 1.4.1