Add a paragraph to summarize the motivation for releases since 5.815
[libwww-perl-eserte.git] / t / net / mirror.t
blob57e744c4860c3cfdd4fd4010bf49243d831c87c5
2 # Test mirroring a file
5 require "net/config.pl";
6 require LWP::Protocol::http;
7 require LWP::UserAgent;
8 require HTTP::Status;
10 print "1..2\n";
12 my $ua = new LWP::UserAgent;    # create a useragent to test
14 my $url = "http://$net::httpserver/";
15 my $copy = "lwp-test-$$"; # downloaded copy
17 my $response = $ua->mirror($url, $copy);
19 if ($response->code == &HTTP::Status::RC_OK) {
20     print "ok 1\n";
22 else {
23     print "not ok 1\n";
26 # OK, so now do it again, should get Not-Modified
27 $response = $ua->mirror($url, $copy);
28 if ($response->code == &HTTP::Status::RC_NOT_MODIFIED) {
29     print "ok 2\n";
31 else {
32     print "nok ok 2\n";
34 unlink($copy);
36 $net::httpserver = $net::httpserver;  # avoid -w warning