X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_component_controller_args.t;h=861b4ad631f3517fd33170297582ddc74a030ce8;hb=92f9d3ad4cba9d517c9819c136b4115e917dc46b;hp=0b869f50738410e4cfa28fea2927bdb1ab687d88;hpb=642026ea901ef434f74d029a8374f5df0b6168eb;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live_component_controller_args.t b/t/live_component_controller_args.t index 0b869f5..861b4ad 100644 --- a/t/live_component_controller_args.t +++ b/t/live_component_controller_args.t @@ -11,23 +11,23 @@ use URI::Escape; our @paths; our $iters; -BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; +BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; - # add special paths to test here - @paths = ( - # all reserved in uri's - qw~ : / ? [ ] @ ! $ & ' ( ) * + ; = ~, ',' , '#', + # add special paths to test here + @paths = ( + # all reserved in uri's + qw~ : / ? [ ] @ ! $ & ' ( ) * + ; = ~, ',' , '#', - # unreserved - 'a'..'z','A'..'Z',0..9,qw( - . _ ~ ), - " ", + # unreserved + 'a'..'z','A'..'Z',0..9,qw( - . _ ~ ), + " ", - # just to test %2F/% - [ qw~ / / ~ ], + # just to test %2F/% + [ qw~ / / ~ ], - # testing %25/%25 - [ qw~ % % ~ ], - ); + # testing %25/%25 + [ qw~ % % ~ ], + ); } use Test::More tests => 6*@paths * $iters; @@ -62,29 +62,37 @@ sub run_test_for { } else { $path = uri_escape($test); } + + SKIP: + { + # Skip %2F, ., [, (, and ) tests on real webservers + # Both Apache and lighttpd don't seem to like these + if ( $ENV{CATALYST_SERVER} && $path =~ /(?:%2F|\.|%5B|\(|\))/ ) { + skip "Skipping $path tests on remote server", 6; + } - my $response; + my $response; - ok( $response = request("http://localhost/args/args/$path"), "Requested args for path $path"); + ok( $response = request("http://localhost/args/args/$path"), "Requested args for path $path"); - is( $response->content, $test, 'as args' ); + is( $response->content, $test, "$test as args" ); - undef $response; + undef $response; - ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path"); + ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path"); - is( $response->content, $test, 'as params' ); + is( $response->content, $test, "$test as params" ); - undef $response; + undef $response; - if( $test =~ m{/} ) { - $test =~ s{/}{}g; - $path = uri_escape( $test ); - } - - ok( $response = request("http://localhost/chained/multi_cap/$path/baz"), "Requested capture for path $path"); + if( $test =~ m{/} ) { + $test =~ s{/}{}g; + $path = uri_escape( $test ); + } - is( $response->content, join( ', ', split( //, $test ) ) ."; ", 'as capture' ); + ok( $response = request("http://localhost/chained/multi_cap/$path/baz"), "Requested capture for path $path"); + is( $response->content, join( ', ', split( //, $test ) ) ."; ", "$test as capture" ); + } }