From 6aa2a7cc9879228cd6c910734beeb8f8688811e9 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sat, 16 Jun 2012 13:05:03 +0200 Subject: [PATCH] Add new test --- tests/ChangeLog | 6 ++++++ tests/Makefile.am | 1 + tests/Test-stdouterr.px | 48 +++++++++++++++++++++++++++++++++++++++++ tests/run-px | 1 + 4 files changed, 56 insertions(+) create mode 100755 tests/Test-stdouterr.px diff --git a/tests/ChangeLog b/tests/ChangeLog index f686c03d..e12d8b54 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2012-06-16 Giuseppe Scrivano + + * Makefile.am (EXTRA_DIST): Add Test-stdouterr.px. + * run-px (tests): Likewise. + * Test-stdouterr.px: New file. + 2011-06-03 Merinov Nikolay * Test-idn-cmd-utf8.px: Added test for idn with utf-8 local encoding. diff --git a/tests/Makefile.am b/tests/Makefile.am index 6cdbb991..9ff302cd 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 00000000..d594ead0 --- /dev/null +++ b/tests/Test-stdouterr.px @@ -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 + diff --git a/tests/run-px b/tests/run-px index 21074cc9..657194fc 100755 --- a/tests/run-px +++ b/tests/run-px @@ -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', -- 2.39.2