import more Method::Signatures tests
[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
19 # not using a type here, so we won't expect Moose *or* Mouse to get loaded
20 method foo1 ($bar) {};
21}
22
23my $foobar = Foo::Bar->new;
24
25# at this point, neither Mouse nor Moose should be loaded
26
27is $INC{'Mouse/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';
28is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';
29
30
31$foobar->foo1(42);
32
33# _still_ should have no Moose and no Mouse, because we haven't requested any type checking
34
35is $INC{'Mouse/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';
36is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';
37
38
39done_testing;