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

[svn:parrot] r34621 - branches/rvar/languages/perl6/t/pmc

From:
pmichaud
Date:
December 29, 2008 23:11
Subject:
[svn:parrot] r34621 - branches/rvar/languages/perl6/t/pmc
Message ID:
20081230071141.E50A8CB9FA@x12.develooper.com
Author: pmichaud
Date: Mon Dec 29 23:11:41 2008
New Revision: 34621

Modified:
   branches/rvar/languages/perl6/t/pmc/objectref.t

Log:
[rakudo]:  Update t/pmc/objectref.t tests to not rely on 'assign' op.


Modified: branches/rvar/languages/perl6/t/pmc/objectref.t
==============================================================================
--- branches/rvar/languages/perl6/t/pmc/objectref.t	(original)
+++ branches/rvar/languages/perl6/t/pmc/objectref.t	Mon Dec 29 23:11:41 2008
@@ -25,7 +25,7 @@
     plan(4)
 
     init()
-    assign_val()
+    init_pmc()
     meth_call()
     multi_call()
 .end    
@@ -35,17 +35,16 @@
     # ObjectRef is initialized to contain an undef.
     $P1 = new "ObjectRef"
     $S1 = typeof $P1
-    is($S1, 'Undef', 'typeof newclass retval')
+    is($S1, 'Object', 'typeof newclass retval')
 .end
 
 
-.sub assign_val
+.sub init_pmc
     # Assigning a value.
-    $P1 = new 'ObjectRef'
     $P2 = get_hll_global 'Int'
     $P2 = $P2.'new'()
     $P2 = 42
-    assign $P1, $P2
+    $P1 = new 'ObjectRef', $P2
 
     # Get integer value; see what we have stored.
     $I0 = $P1
@@ -55,9 +54,8 @@
 
 .sub meth_call
     # Check we can call methods.
-    $P1 = new 'ObjectRef'
     $P2 = 'list'(1,2,3)
-    assign $P1, $P2
+    $P1 = new 'ObjectRef', $P2
     $I0 = $P1.'elems'()
     is($I0, 3, 'method calls on value work')
 .end
@@ -66,15 +64,13 @@
 .sub multi_call
     # Try and do a multi-dispatch call with two items.
     .local pmc x, y
-    x = new 'ObjectRef'
-    y = new 'ObjectRef'
     $P2 = get_hll_global 'Int'
     $P3 = $P2.'new'()
     $P3 = 35
-    x = $P3
+    x = new 'ObjectRef', $P3
     $P4 = $P2.'new'()
     $P4 = 7
-    y = $P4
+    y = new 'ObjectRef', $P4
     $P5 = 'infix:+'(x, y)
     $I0 = $P5
     is($I0, 42, 'multi call worked')



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