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