From 92b2323253a9cc0e5e3491fe1895ef710315aed7 Mon Sep 17 00:00:00 2001 From: mtortonesi Date: Wed, 27 Dec 2006 01:00:12 -0800 Subject: [PATCH] [svn] Minor fixes to test suite. --- tests/ChangeLog | 4 ++++ tests/HTTPServer.pm | 6 +++--- tests/Test-HTTP-Content-Disposition-1.px | 2 +- tests/Test-HTTP-Content-Disposition-2.px | 2 +- tests/Test-HTTP-Content-Disposition.px | 2 +- tests/Test-O-nonexisting.px | 2 +- tests/Test-Restrict-Lowercase.px | 2 +- tests/Test-Restrict-Uppercase.px | 2 +- tests/Test-np.px | 10 +++++----- tests/Test.pm | 20 ++++++++++---------- 10 files changed, 28 insertions(+), 24 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index 618e6563..132472fb 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2006-12-22 Mauro Tortonesi + + * HTTPTest.pm: Don't ignore initial '/' character in requested URLs. + 2006-11-10 Mauro Tortonesi * Test-np.px: Added test for -np. diff --git a/tests/HTTPServer.pm b/tests/HTTPServer.pm index 2d56160a..d29ea307 100755 --- a/tests/HTTPServer.pm +++ b/tests/HTTPServer.pm @@ -32,9 +32,9 @@ sub run { if ($url_path =~ m{/$}) { # append 'index.html' $url_path .= 'index.html'; } - if ($url_path =~ m{^/}) { # remove trailing '/' - $url_path = substr ($url_path, 1); - } + #if ($url_path =~ m{^/}) { # remove trailing '/' + # $url_path = substr ($url_path, 1); + #} if ($log) { print STDERR "Method: ", $req->method, "\n"; print STDERR "Path: ", $url_path, "\n"; diff --git a/tests/Test-HTTP-Content-Disposition-1.px b/tests/Test-HTTP-Content-Disposition-1.px index 3727ad16..da27e3e1 100755 --- a/tests/Test-HTTP-Content-Disposition-1.px +++ b/tests/Test-HTTP-Content-Disposition-1.px @@ -64,7 +64,7 @@ my %expected_downloaded_files = ( ############################################################################### -my $the_test = HTTPTest->new (name => "Test6", +my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition-1", input => \%urls, cmdline => $cmdline, errcode => $expected_error_code, diff --git a/tests/Test-HTTP-Content-Disposition-2.px b/tests/Test-HTTP-Content-Disposition-2.px index 8064f76b..589329f5 100755 --- a/tests/Test-HTTP-Content-Disposition-2.px +++ b/tests/Test-HTTP-Content-Disposition-2.px @@ -64,7 +64,7 @@ my %expected_downloaded_files = ( ############################################################################### -my $the_test = HTTPTest->new (name => "Test7", +my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition-2", input => \%urls, cmdline => $cmdline, errcode => $expected_error_code, diff --git a/tests/Test-HTTP-Content-Disposition.px b/tests/Test-HTTP-Content-Disposition.px index c9bc62fa..465c43fb 100755 --- a/tests/Test-HTTP-Content-Disposition.px +++ b/tests/Test-HTTP-Content-Disposition.px @@ -45,7 +45,7 @@ my %expected_downloaded_files = ( ############################################################################### -my $the_test = HTTPTest->new (name => "Test5", +my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition", input => \%urls, cmdline => $cmdline, errcode => $expected_error_code, diff --git a/tests/Test-O-nonexisting.px b/tests/Test-O-nonexisting.px index 676bd5f4..b341b7f1 100755 --- a/tests/Test-O-nonexisting.px +++ b/tests/Test-O-nonexisting.px @@ -35,7 +35,7 @@ my %expected_downloaded_files = ( ############################################################################### -my $the_test = HTTPTest->new (name => "Test4", +my $the_test = HTTPTest->new (name => "Test-O-nonexisting", input => \%urls, cmdline => $cmdline, errcode => $expected_error_code, diff --git a/tests/Test-Restrict-Lowercase.px b/tests/Test-Restrict-Lowercase.px index 98c8ed60..035b47a8 100755 --- a/tests/Test-Restrict-Lowercase.px +++ b/tests/Test-Restrict-Lowercase.px @@ -44,7 +44,7 @@ my %expected_downloaded_files = ( ############################################################################### -my $the_test = HTTPTest->new (name => "Test9", +my $the_test = HTTPTest->new (name => "Test-Restrict-Lowercase", input => \%urls, cmdline => $cmdline, errcode => $expected_error_code, diff --git a/tests/Test-Restrict-Uppercase.px b/tests/Test-Restrict-Uppercase.px index e2294030..05e5bcde 100755 --- a/tests/Test-Restrict-Uppercase.px +++ b/tests/Test-Restrict-Uppercase.px @@ -44,7 +44,7 @@ my %expected_downloaded_files = ( ############################################################################### -my $the_test = HTTPTest->new (name => "Test9", +my $the_test = HTTPTest->new (name => "Test-Restrict-Uppercase", input => \%urls, cmdline => $cmdline, errcode => $expected_error_code, diff --git a/tests/Test-np.px b/tests/Test-np.px index 09b77da4..dcb165fd 100755 --- a/tests/Test-np.px +++ b/tests/Test-np.px @@ -77,7 +77,7 @@ EOF # code, msg, headers, content my %urls = ( - 'firstlevel/index.html' => { + '/firstlevel/index.html' => { code => "200", msg => "Dontcare", headers => { @@ -85,7 +85,7 @@ my %urls = ( }, content => $mainpage, }, - 'firstlevel/secondpage.html' => { + '/firstlevel/secondpage.html' => { code => "200", msg => "Dontcare", headers => { @@ -93,7 +93,7 @@ my %urls = ( }, content => $secondpage, }, - 'firstlevel/lowerlevel/thirdpage.html' => { + '/firstlevel/lowerlevel/thirdpage.html' => { code => "200", msg => "Dontcare", headers => { @@ -101,7 +101,7 @@ my %urls = ( }, content => $thirdpage, }, - 'firstlevel/fourthpage.html' => { + '/firstlevel/fourthpage.html' => { code => "200", msg => "Dontcare", headers => { @@ -109,7 +109,7 @@ my %urls = ( }, content => $fourthpage, }, - 'higherlevelpage.html' => { + '/higherlevelpage.html' => { code => "200", msg => "Dontcare", headers => { diff --git a/tests/Test.pm b/tests/Test.pm index 058a7c50..f1934de4 100755 --- a/tests/Test.pm +++ b/tests/Test.pm @@ -21,16 +21,16 @@ my @unexpected_downloads = (); _output => {}, ); - sub _default_for - { - my ($self, $attr) = @_; - $_attr_data{$attr}; - } - - sub _standard_keys - { - keys %_attr_data; - } + sub _default_for + { + my ($self, $attr) = @_; + $_attr_data{$attr}; + } + + sub _standard_keys + { + keys %_attr_data; + } } -- 2.39.2