]> sjero.net Git - wget/blob - tests/Test-ftp-recursive.px
NEWS: cite --start-pos
[wget] / tests / Test-ftp-recursive.px
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings;
5
6 use FTPTest;
7
8
9 ###############################################################################
10
11 my $afile = <<EOF;
12 Some text.
13 EOF
14
15 my $bfile = <<EOF;
16 Some more text.
17 EOF
18
19 $afile =~ s/\n/\r\n/;
20 $bfile =~ s/\n/\r\n/;
21
22 # code, msg, headers, content
23 my %urls = (
24     '/foo/afile.txt' => {
25         content => $afile,
26     },
27     '/bar/baz/bfile.txt' => {
28         content => $bfile,
29     },
30 );
31
32 my $cmdline = $WgetTest::WGETPATH . " -S -nH -r ftp://localhost:{{port}}/";
33
34 my $expected_error_code = 0;
35
36 my %expected_downloaded_files = (
37     'foo/afile.txt' => {
38         content => $afile,
39     },
40     'bar/baz/bfile.txt' => {
41         content => $bfile,
42     },
43 );
44
45 ###############################################################################
46
47 my $the_test = FTPTest->new (name => "Test-ftp-recursive",
48                              input => \%urls,
49                              cmdline => $cmdline,
50                              errcode => $expected_error_code,
51                              output => \%expected_downloaded_files);
52 exit $the_test->run();
53
54 # vim: et ts=4 sw=4
55