4 use HTTP::Request::Common;
6 # In DEBUG mode, we get not a number warnigs
11 package MyApp::Controller::Root;
12 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
14 use base 'Catalyst::Controller';
16 sub root :Chained(/) PathPrefix CaptureArgs(0) { }
18 sub test :Chained(root) Args('"Int"') {
20 $c->response->body("This is the body");
23 sub infinity :Chained(root) PathPart('test') Args {
25 $c->response->body("This is the body");
26 Test::More::is $c->action->comparable_arg_number, ~0;
29 sub midpoint :Chained(root) PathPart('') CaptureArgs('"Int"') {
31 Test::More::is $c->action->number_of_captures, 1;
32 #Test::More::is $c->action->number_of_captures_constraints, 1;
35 sub endpoint :Chained('midpoint') Args('"Int"') {
37 Test::More::is $c->action->comparable_arg_number, 1;
38 Test::More::is $c->action->normalized_arg_number, 1;
41 sub local :Local Args {
43 $c->response->body("This is the body");
44 Test::More::is $c->action->comparable_arg_number, ~0;
53 $SIG{__WARN__} = sub { $error = shift };
55 MyApp->setup('-Log=fatal');
58 use Catalyst::Test 'MyApp';
60 request GET '/root/test/a/b/c';
61 request GET '/root/local/a/b/c';
62 request GET '/root/11/endpoint/22';
66 unlike($error, qr[Argument ""Int"" isn't numeric in repeat]);