Commit | Line | Data |
a018b5bb |
1 | use Test::More tests=>5; |
2 | use MooseX::Types::Structured qw(Tuple slurpy); |
3 | use MooseX::Types qw(Str Object); |
4 | |
5 | use_ok 'MooseX::Meta::TypeConstraint::Structured'; |
6 | use_ok 'Moose::Util::TypeConstraints'; |
7 | |
8 | ok my $int = find_type_constraint('Int') => 'Got Int'; |
9 | ok my $str = find_type_constraint('Str') => 'Got Str'; |
10 | ok my $obj = find_type_constraint('Object') => 'Got Object'; |
11 | ok my $arrayref = find_type_constraint('ArrayRef') => 'Got ArrayRef'; |
12 | |
13 | my $a = [1,2,3,4]; |
14 | |
15 | |
16 | package Dependent; |
17 | |
18 | use overload( |
19 | '&{}' => sub { |
20 | warn 'sdfsdfsdfsdfsdf'; |
21 | return sub {}; |
22 | }, |
23 | ); |
24 | |
25 | sub new { |
26 | my $class = shift @_; |
27 | return bless {a=>1}, $class; |
28 | } |
29 | |
30 | 1; |
31 | |
32 | my $dependent = Dependent->new($int); |
33 | |
34 | $dependent->(); |
35 | |