X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Fbad_warnings.t;h=b7bc17d63459f883967b17debf372c6bb6b9638e;hp=2aabc28d474063d5cc07e8d091f90cb9f4e5dba7;hb=88e5a8b0c4d28e46b8ba6b6b9567063e57af9063;hpb=356e750347c4dd4bfe56a3b142252fbbf4c345b7 diff --git a/t/bad_warnings.t b/t/bad_warnings.t index 2aabc28..b7bc17d 100644 --- a/t/bad_warnings.t +++ b/t/bad_warnings.t @@ -3,7 +3,7 @@ use strict; use Test::More; use HTTP::Request::Common; -# In DEBUG mode, we get not a number warnigs +# In DEBUG mode, we get not a number warnigs my $error; @@ -20,16 +20,28 @@ my $error; $c->response->body("This is the body"); } - sub infinity :Chained(root) PathPart('test') Args { + sub infinity :Chained(root) PathPart('test') Args { my ($self, $c) = @_; $c->response->body("This is the body"); - Test::More::is $c->action->normalized_arg_number, ~0; + Test::More::is $c->action->comparable_arg_number, ~0; + } + + sub midpoint :Chained(root) PathPart('') CaptureArgs('"Int"') { + my ($self, $c) = @_; + Test::More::is $c->action->number_of_captures, 1; + #Test::More::is $c->action->number_of_captures_constraints, 1; + } + + sub endpoint :Chained('midpoint') Args('"Int"') { + my ($self, $c) = @_; + Test::More::is $c->action->comparable_arg_number, 1; + Test::More::is $c->action->normalized_arg_number, 1; } sub local :Local Args { my ($self, $c) = @_; $c->response->body("This is the body"); - Test::More::is $c->action->normalized_arg_number, ~0; + Test::More::is $c->action->comparable_arg_number, ~0; } @@ -47,6 +59,8 @@ use Catalyst::Test 'MyApp'; request GET '/root/test/a/b/c'; request GET '/root/local/a/b/c'; +request GET '/root/11/endpoint/22'; + if($error) { unlike($error, qr[Argument ""Int"" isn't numeric in repeat]); @@ -54,4 +68,4 @@ if($error) { ok 1; } -done_testing(3); +done_testing(6);