import some (modified) MXMS tests
[p5sagit/Function-Parameters.git] / t / foreign / MooseX-Method-Signatures / attributes.t
CommitLineData
595edbcf 1#!perl
2use strict;
3use warnings FATAL => 'all';
4
5use Test::More tests => 2;
6
7use attributes;
8use Function::Parameters qw(:strict);
9
10my $attrs;
11my $cb_called;
12
13sub MODIFY_CODE_ATTRIBUTES {
14 my ($pkg, $code, @attrs) = @_;
15 $cb_called = 1;
16 $attrs = \@attrs;
17 return ();
18}
19
20method moo ($a, $b) : Bar Baz(fubar) {
21}
22
23method foo
24:
25Bar
26:Moo(:Ko{oh)
27: Baz(fu{bar:): { return {} }
28
29ok($cb_called, 'attribute handler got called');
30is_deeply($attrs, [qw/Bar Moo(:Ko{oh) Baz(fu{bar:)/], '... with the right attributes');