8 # This test checks that Wget parses "nofollow" when it appears in <meta
9 # name="robots"> tags, regardless of where in a list of comma-separated
10 # values it appears, and regardless of spelling.
12 # Three different files contain links to the file "bombshell.html", each
13 # with "nofollow" set, at various positions in a list of values for a
14 # <meta name="robots"> tag, and with various degrees of separating
15 # whitesspace. If bombshell.html is downloaded, the test
18 ###############################################################################
20 my $nofollow_start = <<EOF;
21 <meta name="roBoTS" content="noFolLow , foo, bar ">
22 <a href="/bombshell.html">Don't follow me!</a>
25 my $nofollow_mid = <<EOF;
26 <meta name="rObOts" content=" foo , NOfOllow , bar ">
27 <a href="/bombshell.html">Don't follow me!</a>
30 my $nofollow_end = <<EOF;
31 <meta name="RoBotS" content="foo,BAr, nofOLLOw ">
32 <a href="/bombshell.html">Don't follow me!</a>
35 my $nofollow_solo = <<EOF;
36 <meta name="robots" content="nofollow">
37 <a href="/bombshell.html">Don't follow me!</a>
40 # code, msg, headers, content
46 "Content-type" => "text/html",
48 content => $nofollow_start,
54 "Content-type" => "text/html",
56 content => $nofollow_mid,
62 "Content-type" => "text/html",
64 content => $nofollow_end,
70 "Content-type" => "text/html",
72 content => $nofollow_solo,
74 '/bombshell.html' => {
78 "Content-type" => "text/html",
84 my $cmdline = $WgetTest::WGETPATH . " -r -nd "
85 . join(' ',(map "http://localhost:{{port}}/$_.html",
86 qw(start mid end solo)));
88 my $expected_error_code = 0;
90 my %expected_downloaded_files = (
92 content => $nofollow_start,
95 content => $nofollow_mid,
98 content => $nofollow_end,
101 content => $nofollow_solo,
105 ###############################################################################
107 my $the_test = HTTPTest->new (name => "Test-meta-robots",
110 errcode => $expected_error_code,
111 output => \%expected_downloaded_files);
112 exit $the_test->run();