+2014-02-13 Yousong Zhou <yszhou4tech@gmail.com>
+
+ * Test--start-pos.px: Test --start-pos for HTTP downloads.
+ * Test-ftp--start-pos.px: Test --start-pos for FTP downloads.
+ * Test--start-pos--continue.px: Test the case when --start-pos and
+ --continue were both specified.
+
2014-02-13 Yousong Zhou <yszhou4tech@gmail.com>
* Wget.pm.in: Exclude existing files from the check of unexpected
--- /dev/null
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $existingfile = <<EOF;
+content should be preserved.
+EOF
+
+my $wholefile = "1234";
+
+# code, msg, headers, content
+my %urls = (
+ '/somefile.txt' => {
+ code => "206",
+ msg => "Dontcare",
+ headers => {
+ "Content-type" => "text/plain",
+ },
+ content => $wholefile,
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " --start-pos=1 --continue --debug http://localhost:{{port}}/somefile.txt";
+
+my $expected_error_code = 0;
+
+my %existing_files = (
+ 'somefile.txt' => {
+ content => $existingfile,
+ },
+);
+
+my %expected_downloaded_files = (
+ 'somefile.txt.1' => {
+ content => substr($wholefile, 1),
+ },
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test--start-pos--continue",
+ 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
+
+
--- /dev/null
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $dummyfile = "1234";
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.txt' => {
+ code => "206",
+ msg => "Dontcare",
+ headers => {
+ "Content-Type" => "text/plain",
+ },
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " --start-pos=1 http://localhost:{{port}}/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'dummy.txt' => {
+ content => substr($dummyfile, 1),
+ }
+);
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test--start-pos",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
+
--- /dev/null
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use FTPTest;
+
+
+###############################################################################
+
+my $dummyfile = "1234";
+
+# code, msg, headers, content
+my %urls = (
+ '/dummy.txt' => {
+ content => $dummyfile
+ },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " --start-pos=1 ftp://localhost:{{port}}/dummy.txt";
+
+my $expected_error_code = 0;
+
+my %expected_downloaded_files = (
+ 'dummy.txt' => {
+ content => substr($dummyfile, 1),
+ }
+);
+
+###############################################################################
+
+my $the_test = FTPTest->new (name => "Test-ftp--start-pos",
+ input => \%urls,
+ cmdline => $cmdline,
+ errcode => $expected_error_code,
+ output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
+
+
+
'Test--spider-r--no-content-disposition-trivial.px',
'Test--spider-r.px',
'Test--httpsonly-r.px',
+ 'Test--start-pos.px',
+ 'Test-ftp--start-pos.px',
+ 'Test--start-pos--continue.px',
);
foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {