Skip to content

Commit

Permalink
Improve test for role composition conflict error; don't require it us…
Browse files Browse the repository at this point in the history
…es the word collides, but do require it mentions the names of the roles.
  • Loading branch information
jnthn committed Sep 21, 2011
1 parent 91a5e7a commit cdb3f48
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions S14-roles/composition.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 23;
plan 25;

# L<S14/Roles/"Roles may be composed into a class at compile time">

Expand Down Expand Up @@ -112,8 +112,10 @@ ok rB !~~ RT64002, 'role not matched by second role it does';
role RT72856A { method foo {} };
role RT72856B { method foo {} };
eval 'class RT72856C does RT72856A does RT72856B {}';
ok $! ~~ /foo .* collides/,
ok $! ~~ /foo/,
'method of the same name from two different roles collide in a class composition';
ok $! ~~ /RT72856A/, 'colliding role mentioned in error (1)';
ok $! ~~ /RT72856B/, 'colliding role mentioned in error (2)';
}

done;
Expand Down

0 comments on commit cdb3f48

Please sign in to comment.