From 31f28a8e149ab036f7072af29eb6b492e965c67f Mon Sep 17 00:00:00 2001 From: jnthn Date: Sat, 19 Jun 2010 20:13:14 +0000 Subject: [PATCH] [t/spec] Add a test for RT#75822 and correct another test so we can un-todo it. git-svn-id: http://svn.pugscode.org/pugs@31380 c213334d-75ef-0310-aa23-eaa082d1ae64 --- S14-roles/instantiation.t | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/S14-roles/instantiation.t b/S14-roles/instantiation.t index a20f016f19..0acce9c50b 100644 --- a/S14-roles/instantiation.t +++ b/S14-roles/instantiation.t @@ -8,7 +8,7 @@ use Test; # classes. Hence, RoleName.new() instantiates an object that will probably fail # on all stubs. -plan 18; +plan 19; role SampleRole { method sample_method () { 42 } @@ -25,8 +25,7 @@ role SampleRole { my $obj2 = SampleRole.new; ok $obj.WHAT === $obj2.WHAT, "Punned role classes have the same .WHAT"; - #?rakudo todo 'protoobject regression' - is ~$obj.WHAT, 'SampleRole', '.WHAT as a string gives the name of the role'; + is ~$obj.WHAT, 'SampleRole()', '.WHAT as a string gives the name of the role'; } role WithAttr { @@ -57,6 +56,12 @@ role ParaRole[$x] { is $obj2.get_x, 100, "instantiated object has method with correct associated role parameter"; } +role ParaRole2Args[$x, $y] { + method x { $x + $y } +} + +is ParaRole2Args[4, 5].new.x, 9, 'instantiating a parametric role with two arguments works'; + # Can also pun a role and inherit from the punned class. { class TestA is SampleRole { }