File: typeload_nomoose.t

package info (click to toggle)
libmethod-signatures-perl 20170211-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 672 kB
  • sloc: perl: 3,860; makefile: 2
file content (36 lines) | stat: -r--r--r-- 582 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;


{
    package Foo::Bar;

    use strict;
    use warnings;

    use Method::Signatures;

    method new ($class:) { bless {}, $class; }

    method foo1 (Int $bar) {};
}

my $foobar = Foo::Bar->new;

# at this point, Moose should not be loaded (yet)

is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';


$foobar->foo1(42);

# now we should have loaded Mouse to do our type checking

is $INC{'Moose/Util/TypeConstraints.pm'}, undef, "didn't load Moose";


done_testing;