update changelog in prep for release
[catagits/CatalystX-Declare.git] / t / lib / TestApp / Controller / SignatureMatching.pm
CommitLineData
ed4a2203 1use CatalystX::Declare;
2
3controller TestApp::Controller::SignatureMatching {
4
bd1badfa 5 method mark (Catalyst $ctx) {
6 $ctx->response->body( $ctx->action->reverse );
7 }
8
9
ed4a2203 10 action base as 'sigmatch' under '/';
11
12 under base {
13
14 final action int (Int $x)
bd1badfa 15 as test { $self->mark($ctx) }
ed4a2203 16
17 final action str (Str $x where { /^[a-z]+$/ })
bd1badfa 18 as test { $self->mark($ctx) }
ed4a2203 19
20 final action rest (@)
bd1badfa 21 as '' { $self->mark($ctx) }
accfac7d 22
23
24 final action opt_param (Int :$page?) {
25 $ctx->response->body("page $page");
26 }
27
28
29 final action req_param (Int :$page!) {
30 $ctx->response->body("page $page");
31 }
32
33 final action req_param_none as req_param {
34 $ctx->response->body('no page');
35 }
36
37
38 # TODO
39 action mid_with_param (Int :$page!) as '';
40 action mid_no_param as '';
41 final action end_with_param under mid_with_param as mid { $self->mark($ctx) }
42 final action end_no_param under mid_no_param as mid { $self->mark($ctx) }
43
44
45 final action with_list (ArrayRef[Int] :$filter) {
46 $ctx->response->body(join ', ', sort @$filter);
47 }
48
49
50 final action getpost (Int :$id) {
51 $ctx->response->body($id);
52 }
ed4a2203 53 }
54}