File: use-after-no.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 (40 lines) | stat: -rw-r--r-- 502 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
use Moo::_strictures;
use Test::More;

ok eval q{
  package Spoon;
  use Moo;

  has foo => ( is => 'ro' );

  no Moo;

  use Moo;

  has foo2 => ( is => 'ro' );

  no Moo;

  1;
}, "subs imported on 'use Moo;' after 'no Moo;'"
    or diag $@;

ok eval q{
  package Roller;
  use Moo::Role;

  has foo => ( is => 'ro' );

  no Moo::Role;

  use Moo::Role;

  has foo2 => ( is => 'ro' );

  no Moo::Role;

  1;
}, "subs imported on 'use Moo::Role;' after 'no Moo::Role;'"
    or diag $@;

done_testing;