X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=tests%2FTest-iri.px;h=4865a1cd29ddc089138ae6f2e01c93f900d7f322;hp=3f4cf3fd4a5c2a1ab2e896854b4eb7e66af9f207;hb=320cfdcb658e8d6556ae9dfd902c2db1db866a6b;hpb=a0c75a96c03353e3dbeb963758bf36ea20cc0cb6 diff --git a/tests/Test-iri.px b/tests/Test-iri.px index 3f4cf3fd..4865a1cd 100755 --- a/tests/Test-iri.px +++ b/tests/Test-iri.px @@ -1,7 +1,9 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl use strict; +use warnings; +use WgetFeature qw(iri); use HTTPTest; # cf. http://en.wikipedia.org/wiki/Latin1 @@ -25,7 +27,6 @@ my $eacute_l1 = "\xE9"; my $eacute_u8 = "\xC3\xA9"; my $eurosign_l15 = "\xA4"; my $eurosign_u8 = "\xE2\x82\xAC"; -my $eurosign2_u8 = "\xE2%82\xAC"; # version wget use... sXXXav my $pageindex = < @@ -148,14 +149,9 @@ my %urls = ( '/p2_%C3%A9%C3%A9n.html' => { # UTF-8 encoded code => "200", msg => "Ok", - headers => { - "Content-type" => "text/html; charset=ISO-8859-1", + request_headers => { + "Referer" => qr|http://localhost:[0-9]+/p1_fran%E7ais.html|, }, - content => $pageeen, - }, - '/p2_%E9%E9n.html' => { - code => "200", - msg => "Ok", headers => { "Content-type" => "text/html; charset=ISO-8859-1", }, @@ -180,6 +176,9 @@ my %urls = ( '/p4_m%C3%A9%C3%A9r.html' => { code => "200", msg => "Ok", + request_headers => { + "Referer" => qr|http://localhost:[0-9]+/p2_%C3%A9%C3%A9n.html|, + }, headers => { "Content-type" => "text/plain; charset=UTF-8", }, @@ -187,7 +186,7 @@ my %urls = ( }, ); -my $cmdline = $WgetTest::WGETPATH . " --iri -nH -r http://localhost:{{port}}/"; +my $cmdline = $WgetTest::WGETPATH . " --iri --trust-server-names --restrict-file-names=nocontrol -nH -r http://localhost:{{port}}/"; my $expected_error_code = 0; @@ -204,7 +203,7 @@ my %expected_downloaded_files = ( "p2_${eacute_u8}${eacute_u8}n.html" => { content => $pageeen, }, - "p3_${eurosign2_u8}${eurosign2_u8}${eurosign2_u8}.html" => { + "p3_${eurosign_u8}${eurosign_u8}${eurosign_u8}.html" => { content => $pageeuro, }, "p4_m${eacute_u8}${eacute_u8}r.html" => { @@ -215,9 +214,9 @@ my %expected_downloaded_files = ( ############################################################################### my $the_test = HTTPTest->new (name => "Test-iri", - input => \%urls, - cmdline => $cmdline, - errcode => $expected_error_code, + input => \%urls, + cmdline => $cmdline, + errcode => $expected_error_code, output => \%expected_downloaded_files); exit $the_test->run();