]> sjero.net Git - wget/commitdiff
Test for -O, -nc.
authorMicah Cowan <micah@cowan.name>
Fri, 22 Aug 2008 23:56:18 +0000 (16:56 -0700)
committerMicah Cowan <micah@cowan.name>
Fri, 22 Aug 2008 23:56:18 +0000 (16:56 -0700)
tests/Test-O-nc.px [new file with mode: 0755]
tests/run-px

diff --git a/tests/Test-O-nc.px b/tests/Test-O-nc.px
new file mode 100755 (executable)
index 0000000..08819e4
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = <<EOF;
+Don't care.
+EOF
+
+# code, msg, headers, content
+my %urls = (
+    '/dummy.txt' => {
+        code => "200",
+        msg => "Dontcare",
+        headers => {
+            "Content-type" => "text/plain",
+        },
+        content => $dummyfile
+    },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -nc -O out http://localhost:{{port}}/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+    'out' => {
+        content => $dummyfile,
+    }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-O-nc",
+                              input => \%urls, 
+                              cmdline => $cmdline, 
+                              errcode => $expected_error_code, 
+                              output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
index 37f14324d59f535a4fb99d5d215aa46719fe9aef..f6c8cf6e5573ffd2f2a53f81a9c8aacf0f186d80 100755 (executable)
@@ -36,6 +36,7 @@ my @tests = (
     'Test-O--no-content-disposition-trivial.px',
     'Test-O-nonexisting.px',
     'Test-O.px',
+    'Test-O-nc.px',
     'Test-Restrict-Lowercase.px',
     'Test-Restrict-Uppercase.px',
     'Test--spider-fail.px',