7 use lib "$FindBin::Bin/lib";
11 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
13 use Test::More tests => 30*$iters;
14 use Catalyst::Test 'TestApp';
16 if ( $ENV{CAT_BENCHMARK} ) {
18 Benchmark::timethis( $iters, \&run_tests );
30 request('http://localhost/action/path/a%20path%20with%20spaces'),
33 ok( $response->is_success, 'Response Successful 2xx' );
34 is( $response->content_type, 'text/plain', 'Response Content-Type' );
36 $response->header('X-Catalyst-Action'),
37 'action/path/a%20path%20with%20spaces',
41 $response->header('X-Test-Class'),
42 'TestApp::Controller::Action::Path',
47 qr/^bless\( .* 'Catalyst::Request' \)$/s,
48 'Content is a serialized Catalyst::Request'
53 ok( my $response = request('http://localhost/action/path/åäö'),
55 ok( $response->is_success, 'Response Successful 2xx' );
56 is( $response->content_type, 'text/plain', 'Response Content-Type' );
57 is( $response->header('X-Catalyst-Action'),
58 'action/path/%C3%A5%C3%A4%C3%B6', 'Test Action' );
60 $response->header('X-Test-Class'),
61 'TestApp::Controller::Action::Path',
66 qr/^bless\( .* 'Catalyst::Request' \)$/s,
67 'Content is a serialized Catalyst::Request'
72 ok( my $response = request('http://localhost/action/path/'),
74 ok( $response->is_success, 'Response Successful 2xx' );
75 is( $response->content_type, 'text/plain', 'Response Content-Type' );
76 is( $response->header('X-Catalyst-Action'),
77 'action/path', 'Test Action' );
79 $response->header('X-Test-Class'),
80 'TestApp::Controller::Action::Path',
85 qr/^bless\( .* 'Catalyst::Request' \)$/s,
86 'Content is a serialized Catalyst::Request'
91 ok( my $response = request('http://localhost/action/path/spaces_near_parens_singleq'),
93 ok( $response->is_success, 'Response Successful 2xx' );
94 is( $response->content_type, 'text/plain', 'Response Content-Type' );
95 is( $response->header('X-Catalyst-Action'),
96 'action/path/spaces_near_parens_singleq', 'Test Action' );
98 $response->header('X-Test-Class'),
99 'TestApp::Controller::Action::Path',
104 qr/^bless\( .* 'Catalyst::Request' \)$/s,
105 'Content is a serialized Catalyst::Request'
110 ok( my $response = request('http://localhost/action/path/spaces_near_parens_doubleq'),
112 ok( $response->is_success, 'Response Successful 2xx' );
113 is( $response->content_type, 'text/plain', 'Response Content-Type' );
114 is( $response->header('X-Catalyst-Action'),
115 'action/path/spaces_near_parens_doubleq', 'Test Action' );
117 $response->header('X-Test-Class'),
118 'TestApp::Controller::Action::Path',
123 qr/^bless\( .* 'Catalyst::Request' \)$/s,
124 'Content is a serialized Catalyst::Request'