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')