Commit | Line | Data |
700071de |
1 | #!perl |
2 | |
3 | use strict; |
4 | use warnings FATAL => 'all'; |
5 | |
6 | use Test::More; |
7 | |
8 | |
9 | { |
10 | package Foo::Bar; |
11 | |
12 | use strict; |
13 | use warnings; |
14 | |
15 | use Function::Parameters qw(:strict); |
16 | |
17 | method new ($class:) { bless {}, $class; } |
18 | |
1a52f2db |
19 | # not using a type here, so we won't expect Moose to get loaded |
700071de |
20 | method foo1 ($bar) {}; |
21 | } |
22 | |
23 | my $foobar = Foo::Bar->new; |
24 | |
1a52f2db |
25 | # at this point, Moose should not be loaded |
700071de |
26 | |
700071de |
27 | is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call'; |
28 | |
29 | |
30 | $foobar->foo1(42); |
31 | |
1a52f2db |
32 | # _still_ should have no Moose because we haven't requested any type checking |
700071de |
33 | |
700071de |
34 | is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call'; |
35 | |
36 | |
37 | done_testing; |