Commit | Line | Data |
9dac01c7 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin; |
5 | use lib "$FindBin::Bin/../lib"; |
6 | |
7 | our $iters; |
8 | |
9 | BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } |
10 | |
81f25ce6 |
11 | use Test::More; |
9dac01c7 |
12 | use Catalyst::Test 'TestAppMatchSingleArg'; |
13 | |
81f25ce6 |
14 | plan 'skip_all' if ( $ENV{CATALYST_SERVER} ); |
15 | |
16 | plan tests => 3*$iters; |
17 | |
9dac01c7 |
18 | if ( $ENV{CAT_BENCHMARK} ) { |
19 | require Benchmark; |
20 | Benchmark::timethis( $iters, \&run_tests ); |
21 | } |
22 | else { |
23 | for ( 1 .. $iters ) { |
24 | run_tests(); |
25 | } |
26 | } |
27 | |
28 | sub run_tests { |
29 | { |
cdf573a6 |
30 | is(get('/foo/bar/baz'), 'Path', 'multiple args matched :Path'); |
9dac01c7 |
31 | is(get('/foo'), 'Path Args(1)', 'single arg matched :Path Args(1)'); |
cdf573a6 |
32 | is(get('/foo/bar'), 'Path Args(2)', 'two args matched :Path Args(2)'); |
9dac01c7 |
33 | } |
34 | } |