X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Fi386%2Flibwww-perl%2Flibwww-perl-5.813%2Ft%2Fnet%2Fproxy.t;fp=dev%2Fi386%2Flibwww-perl%2Flibwww-perl-5.813%2Ft%2Fnet%2Fproxy.t;h=ce0df7c36d864b35326199b7cd837689dd6aa178;hp=0000000000000000000000000000000000000000;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hpb=df794b845212301ea0d267c919232538bfef356a diff --git a/dev/i386/libwww-perl/libwww-perl-5.813/t/net/proxy.t b/dev/i386/libwww-perl/libwww-perl-5.813/t/net/proxy.t new file mode 100644 index 0000000..ce0df7c --- /dev/null +++ b/dev/i386/libwww-perl/libwww-perl-5.813/t/net/proxy.t @@ -0,0 +1,37 @@ +#!/usr/local/bin/perl -w +# +# Test retrieving a file with a 'ftp://' URL, +# via a HTTP proxy. +# + +print "1..1\n"; + +require "net/config.pl"; +unless (defined $net::ftp_proxy) { + print "not ok 1\n"; + exit 0; +} + +require LWP::Debug; +require LWP::UserAgent; + +#LWP::Debug::level('+'); + +my $ua = new LWP::UserAgent; # create a useragent to test + +$ua->proxy('ftp', $net::ftp_proxy); + +my $url = new URI::URL('ftp://ftp.uninett.no/'); + +my $request = new HTTP::Request('GET', $url); + +my $response = $ua->request($request, undef, undef); + +my $str = $response->as_string; + +if ($response->is_success) { + print "ok 1\n"; +} +else { + print "not ok 1\n"; +}