]> sjero.net Git - wget/commitdiff
Add new test
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 16 Jun 2012 11:05:03 +0000 (13:05 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 16 Jun 2012 11:05:03 +0000 (13:05 +0200)
tests/ChangeLog
tests/Makefile.am
tests/Test-stdouterr.px [new file with mode: 0755]
tests/run-px

index f686c03d5a17827ce6ec3cadfc6de4b5fec1be6e..e12d8b5463243041c8599b302cb900ddd73a0a8b 100644 (file)
@@ -1,3 +1,9 @@
+2012-06-16  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * Makefile.am (EXTRA_DIST): Add Test-stdouterr.px.
+       * run-px (tests): Likewise.
+       * Test-stdouterr.px: New file.
+
 2011-06-03  Merinov Nikolay  <kim.roader@gmail.com>
 
        * Test-idn-cmd-utf8.px: Added test for idn with utf-8 local encoding.
index 6cdbb9915fd47ad5be30d8fcaeb1e14d96a041e3..9ff302cdcbb9c6ae89ca331a165ec5f771d4b340 100644 (file)
@@ -124,6 +124,7 @@ EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
              Test-restrict-ascii.px \
              Test-Restrict-Lowercase.px \
              Test-Restrict-Uppercase.px \
+            Test-stdouterr.px \
              Test--spider-fail.px \
              Test--spider.px \
              Test--spider-r-HTTP-Content-Disposition.px \
diff --git a/tests/Test-stdouterr.px b/tests/Test-stdouterr.px
new file mode 100755 (executable)
index 0000000..d594ead
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use HTTPTest;
+
+
+###############################################################################
+
+# code, msg, headers, content
+my %urls = (
+    '/somefile.txt' => {
+        code => "200",
+        msg => "Dontcare",
+        headers => {
+            "Content-type" => "text/plain",
+        },
+        content => "blabla",
+    },
+);
+
+unless(-e "/dev/full") {
+    exit(2); # skip
+}
+
+my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:{{port}}/somefile.txt -O /dev/full";
+
+my $expected_error_code = 3;
+
+my %existing_files = (
+);
+
+my %expected_downloaded_files = (
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-stdouterr",
+                              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 21074cc9782c6ff16900a4b13d8a2fbf1895fceb..657194fc2d3558b933744297128a71d846020669 100755 (executable)
@@ -74,6 +74,7 @@ my @tests = (
     'Test-restrict-ascii.px',
     'Test-Restrict-Lowercase.px',
     'Test-Restrict-Uppercase.px',
+    'Test-stdouterr.px',
     'Test--spider-fail.px',
     'Test--spider-r-HTTP-Content-Disposition.px',
     'Test--spider-r--no-content-disposition.px',