File: has-before-extends.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 (25 lines) | stat: -rw-r--r-- 362 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
use Moo::_strictures;
use Test::More;

{
  package Fail1;

  use Moo;

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

  package Fail2;

  use Moo;

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

  extends 'Fail1';
}

my $new = Fail2->new({ attr1 => 'value1', attr2 => 'value2' });

is($new->attr1, 'value1', 'inherited attr ok');
is($new->attr2, 'value2', 'subclass attr ok');

done_testing;