Skip to content

Commit

Permalink
[t/spec] Test for attributes in roles having a default value.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@24911 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
jnthn committed Jan 14, 2009
1 parent dd60e8d commit 8b2f712
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion S12-role/attributes.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 4;
plan 5;

# L<S12/Roles/"Roles may have attributes">

Expand Down Expand Up @@ -35,4 +35,10 @@ eval_lives_ok 'class C2 does R2 { has Int $!a }', 'Same name, same type will not
#?rakudo skip 'test passes but Parrot bug gets in the way'
eval_dies_ok 'class C3 does R2 { has $!a }', 'Roles with conflicing attributes';

role R3 {
has $.x = 42;
}
class C4 does R3 { }
is C4.new.x, 42, 'initializing attributes in a role works';

# vim: syn=perl6

0 comments on commit 8b2f712

Please sign in to comment.