File: live_component_controller_action_path_matchsingle.t

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (34 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";

our $iters;

BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }

use Test::More;
use Catalyst::Test 'TestAppMatchSingleArg';

plan 'skip_all' if ( $ENV{CATALYST_SERVER} );

plan tests => 3*$iters;

if ( $ENV{CAT_BENCHMARK} ) {
    require Benchmark;
    Benchmark::timethis( $iters, \&run_tests );
}
else {
    for ( 1 .. $iters ) {
        run_tests();
    }
}

sub run_tests {
    {
        is(get('/foo/bar/baz'), 'Path', 'multiple args matched :Path');
        is(get('/foo'), 'Path Args(1)', 'single arg matched :Path Args(1)');
        is(get('/foo/bar'), 'Path Args(2)', 'two args matched :Path Args(2)');
    }
}