develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34019 - trunk/languages/perl6/t/pmc

From:
jonathan
Date:
December 17, 2008 04:12
Subject:
[svn:parrot] r34019 - trunk/languages/perl6/t/pmc
Message ID:
20081217121243.5B62DCBA12@x12.develooper.com
Author: jonathan
Date: Wed Dec 17 04:12:42 2008
New Revision: 34019

Modified:
   trunk/languages/perl6/t/pmc/perl6multisub-type.t

Log:
[rakudo] Fix a test for multi-dispatch that didn't create classes the Perl 6 way to do so.

Modified: trunk/languages/perl6/t/pmc/perl6multisub-type.t
==============================================================================
--- trunk/languages/perl6/t/pmc/perl6multisub-type.t	(original)
+++ trunk/languages/perl6/t/pmc/perl6multisub-type.t	Wed Dec 17 04:12:42 2008
@@ -73,17 +73,18 @@
     push $P0, $P1
 
     # Couple of classes that do the roles.
-    .local pmc C1, C2
-    C1 = new 'Class'
-    addrole C1, R1
-    C2 = new 'Class'
-    addrole C2, R2
+    .local pmc C1, C2, p6meta
+    p6meta = get_hll_global ['Perl6Object'], '$!P6META'
+    C1 = p6meta.'new_class'('C1', 'parent'=>'Any')
+    p6meta.'add_role'(R1, 'to'=>C1)
+    C2 = p6meta.'new_class'('C2', 'parent'=>'Any')
+    p6meta.'add_role'(R2, 'to'=>C2)
 
     # Tests
-    $P1 = new C1
+    $P1 = C1.'new'()
     $I0 = $P0($P1)
     is($I0, 1, 'dispatch on a role')
-    $P1 = new C2
+    $P1 = C2.'new'()
     $I0 = $P0($P1)
     is($I0, 2, 'dispatch on a role')
 .end



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About