[svn:parrot] r43104 - branches/context_unify3/t/pmc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Wed Dec 16 14:26:46 UTC 2009
Author: whiteknight
Date: Wed Dec 16 14:26:45 2009
New Revision: 43104
URL: https://trac.parrot.org/parrot/changeset/43104
Log:
fix t/pmc/callcontext.t Context attributes are accessed by the getattribute opcode now, not named hash lookup. Hash lookup is for named arguments.
Modified:
branches/context_unify3/t/pmc/callcontext.t
Modified: branches/context_unify3/t/pmc/callcontext.t
==============================================================================
--- branches/context_unify3/t/pmc/callcontext.t Wed Dec 16 14:15:53 2009 (r43103)
+++ branches/context_unify3/t/pmc/callcontext.t Wed Dec 16 14:26:45 2009 (r43104)
@@ -19,7 +19,7 @@
.sub 'main' :main
.include 'test_more.pir'
- plan(85)
+ plan(84)
test_instantiate()
test_get_set_attrs()
@@ -352,68 +352,69 @@
ok($I0, "Got Context")
# Check current_sub first. Other tests relying on it
- $P0 = ctx['current_sub']
+ $P0 = getattribute ctx, 'current_sub'
is($P0, 'test_inspect', 'Got Context.current_sub')
- $P0 = ctx['caller_ctx']
- $I0 = isa $P0, 'Context'
+ $P0 = getattribute ctx, 'caller_ctx'
+ $I0 = isa $P0, 'CallContext'
ok($I0, 'Got Context.caller_ctx')
- $P0 = $P0['current_sub']
+ $P0 = getattribute $P0, 'current_sub'
is($P0, 'main', '... from proper Sub')
- $P0 = ctx['outer_ctx']
- $I0 = isa $P0, 'Context'
+ $P0 = getattribute ctx, 'outer_ctx'
+ $I0 = isa $P0, 'CallContext'
ok($I0, 'Got Context.outer_ctx')
- $P0 = $P0['current_sub']
+ $P0 = getattribute $P0, 'current_sub'
is($P0, 'load', '... from proper Sub')
- $P0 = ctx['lex_pad']
+ $P0 = getattribute ctx, 'lex_pad'
$I0 = isa $P0, 'LexPad'
ok($I0, 'Got Context.lex_pad')
$P1 = $P0['foo_ctx']
$I0 = defined $P1
ok($I0, '... with proper content')
- $P0 = ctx['current_cont']
+ $P0 = getattribute ctx, 'current_cont'
$I0 = isa $P0, 'Continuation'
ok($I0, 'Got Context.current_cont')
- $P0 = ctx['current_object']
+ $P0 = getattribute ctx, 'current_object'
$I0 = isa $P0, 'Foo'
ok($I0, 'Got Context.current_object')
- $P0 = ctx['current_namespace']
+ $P0 = getattribute ctx, 'current_namespace'
ok($P0, 'Got Context.current_namespace')
$P1 = $P0['test_inspect']
is($P1, 'test_inspect', '... with proper content')
# Checking handlers
push_eh done
- $P0 = ctx['handlers']
+ $P0 = getattribute ctx, 'handlers'
$I0 = elements $P0
push_eh cought
# Now we should have one more handler
- $P0 = ctx['handlers']
+ $P0 = getattribute ctx, 'handlers'
$I1 = elements $P0
dec $I1
is($I0, $I1, 'Got Context.handlers')
# Check absurd fields
$I0 = 1
- $P0 = ctx['world_domination']
+ $P0 = getattribute ctx, 'world_domination'
$I0 = 0
cought:
pop_eh
ok($I0, "No world domination in this Context")
- # Current HLL shouldn't be zero
- $P0 = ctx['current_HLL']
+ # Current HLL should be zero
+ # TODO: Rerun similar test in different HLL namespace
+ $P0 = getattribute ctx, 'current_HLL'
$I0 = $P0
- ok($I0, 'Got Context.current_HLL')
+ is($I0, 0, 'Got Context.current_HLL')
- $P0 = ctx['current_hll']
- ok($P0, 'FOO', 'Got Context.current_hll')
+ $P0 = getattribute ctx, 'current_hll'
+ ok($P0, 'parrot', 'Got Context.current_hll')
done:
pop_eh
More information about the parrot-commits
mailing list