]> sjero.net Git - wget/commitdiff
Test-N-no-info.px
authorMicah Cowan <micah@cowan.name>
Sat, 31 May 2008 20:31:05 +0000 (13:31 -0700)
committerMicah Cowan <micah@cowan.name>
Sat, 31 May 2008 20:31:05 +0000 (13:31 -0700)
tests/ChangeLog
tests/Test-N-no-info.px [new file with mode: 0755]
tests/run-px

index 8c40d0825645c824ccc4efeb4ab9162c64476200..f076a2742f9d46ef76344f3b57e3c156aadf93f6 100644 (file)
@@ -4,7 +4,8 @@
        * Test-N-old.px: Make it test only the timestamp, and not the
        content length in addition.
        * Test-N-smaller.px: added.
        * Test-N-old.px: Make it test only the timestamp, and not the
        content length in addition.
        * Test-N-smaller.px: added.
-       * run-px: Added Test-N-smaller.px.
+       * Test-N-no-info.px: added.
+       * run-px: Added Test-N-smaller.px, Test-N-no-info.px.
 
 2008-05-23  Micah Cowan  <micah@cowan.name>
 
 
 2008-05-23  Micah Cowan  <micah@cowan.name>
 
diff --git a/tests/Test-N-no-info.px b/tests/Test-N-no-info.px
new file mode 100755 (executable)
index 0000000..bd83f64
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $currentversion = <<EOF;
+11111111111111111111111111111111111111111111111111
+222222222222222222222222222222222222222222222222222222222222
+3333333333333333333333333333333333333333333333333333333333333333333333
+444444444444444444444444444444444444444444444444444444444444
+55555555555555555555555555555555555555555555555555
+EOF
+
+my $newversion = <<EOF;
+11111111111111111111111111111111111111111111111111
+222222222222222222222222222222222222222222222222222222222222
+EOF
+
+# code, msg, headers, content
+my %urls = (
+    '/somefile.txt' => {
+        code => "200",
+        msg => "Dontcare",
+        headers => {
+            "Content-type" => "text/plain",
+        },
+        content => $newversion,
+    },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:8080/somefile.txt";
+
+my $expected_error_code = 0;
+
+my %existing_files = (
+    'somefile.txt' => {
+        content => $currentversion,
+        timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
+    },
+);
+
+my %expected_downloaded_files = (
+    'somefile.txt' => {
+        content => $newversion,
+    },
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-N-current",
+                              input => \%urls, 
+                              cmdline => $cmdline, 
+                              errcode => $expected_error_code, 
+                              existing => \%existing_files,
+                              output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
index 7cab7531de2a7163fbb19e34d1ce88b4de34cfb0..febb0de4db001ada69b256443d21398624d206fa 100755 (executable)
@@ -21,6 +21,7 @@ my @tests = (
     'Test-HTTP-Content-Disposition.px',
     'Test-N-current.px',
     'Test-N-smaller.px',
     'Test-HTTP-Content-Disposition.px',
     'Test-N-current.px',
     'Test-N-smaller.px',
+    'Test-N-no-info.px',
     'Test-N--no-content-disposition.px',
     'Test-N--no-content-disposition-trivial.px',
     'Test--no-content-disposition.px',
     'Test-N--no-content-disposition.px',
     'Test-N--no-content-disposition-trivial.px',
     'Test--no-content-disposition.px',