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