version 1.0401
[p5sagit/Function-Parameters.git] / t / foreign / Method-Signatures / typeload_notypes.t
CommitLineData
700071de 1#!perl
2
3use strict;
4use warnings FATAL => 'all';
5
6use 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
23my $foobar = Foo::Bar->new;
24
1a52f2db 25# at this point, Moose should not be loaded
700071de 26
700071de 27is $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 34is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';
35
36
37done_testing;