File: typeload_notypes.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 (37 lines) | stat: -r--r--r-- 692 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
37
#!/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; }

    # not using a type here, so we won't expect Moose to get loaded
    method foo1 ($bar) {};
}

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

# at this point, Moose should not be loaded

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


$foobar->foo1(42);

# _still_ should have no Moose because we haven't requested any type checking

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


done_testing;