File: global_underscore.t

package info (click to toggle)
libmoo-perl 2.002005-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 856 kB
  • ctags: 192
  • sloc: perl: 2,561; makefile: 6
file content (44 lines) | stat: -rw-r--r-- 611 bytes parent folder | download | duplicates (3)
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
38
39
40
41
42
43
44
use Moo::_strictures;
use Test::More;
use lib qw(t/lib);
use InlineModule (
  'UnderscoreClass' => q{
    package UnderscoreClass;
    use Moo;
    with qw(UnderscoreRole);
    sub c1 { 'c1' };
    1;
  },
  'UnderscoreRole' => q{
    package UnderscoreRole;
    use Moo::Role;
    use ClobberUnderscore;
    sub r1 { 'r1' };
    1;
  },
  'ClobberUnderscore' => q{
    package ClobberUnderscore;
    sub h1 { 'h1' };
    undef $_;
    1;
  },
);

use_ok('UnderscoreClass');

is(
  UnderscoreClass->c1,
  'c1',
);

is(
  UnderscoreClass->r1,
  'r1',
);

is(
  ClobberUnderscore::h1(),
  'h1',
);

done_testing;