Skip to content

Commit cdb3f48

Browse files
committed
Improve test for role composition conflict error; don't require it uses the word collides, but do require it mentions the names of the roles.
1 parent 91a5e7a commit cdb3f48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

S14-roles/composition.t

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 23;
3+
plan 25;
44

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

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

119121
done;

0 commit comments

Comments
 (0)