mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Add new test
This commit is contained in:
parent
90e9d9e1bd
commit
6aa2a7cc98
@ -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.
|
||||
|
@ -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 \
|
||||
|
48
tests/Test-stdouterr.px
Executable file
48
tests/Test-stdouterr.px
Executable file
@ -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
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user