7 use lib "$FindBin::Bin/lib";
14 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2;
16 # add special paths to test here
18 # all reserved in uri's
19 qw~ : / ? [ ] @ ! $ & ' ( ) * + ; = ~, ',' , '#',
22 'a'..'z','A'..'Z',0..9,qw( - . _ ~ ),
33 use Test::More tests => 6*@paths * $iters;
34 use Catalyst::Test 'TestApp';
36 if ( $ENV{CAT_BENCHMARK} ) {
38 Benchmark::timethis( $iters, \&run_tests );
41 # 11 wallclock secs (10.14 usr + 0.20 sys = 10.34 CPU) @ 15.18/s (n=157)
42 # old dispatcher (r1486):
43 # 11 wallclock secs (10.34 usr + 0.20 sys = 10.54 CPU) @ 13.76/s (n=145)
52 run_test_for($_) for @paths;
60 $path = join "/", map uri_escape($_), @$test;
61 $test = join '', @$test;
63 $path = uri_escape($test);
68 ok( $response = request("http://localhost/args/args/$path"), "Requested args for path $path");
70 is( $response->content, $test, 'as args' );
74 ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path");
76 is( $response->content, $test, 'as params' );
82 $path = uri_escape( $test );
85 ok( $response = request("http://localhost/chained/multi_cap/$path/baz"), "Requested capture for path $path");
87 is( $response->content, join( ', ', split( //, $test ) ) ."; ", 'as capture' );