[svn:parrot] r43166 - in branches/context_unify3_simple/t: op pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Dec 19 23:25:34 UTC 2009


Author: bacek
Date: Sat Dec 19 23:25:33 2009
New Revision: 43166
URL: https://trac.parrot.org/parrot/changeset/43166

Log:
Update tests to use CallContext instead of Context and CallSignature.

Modified:
   branches/context_unify3_simple/t/op/cc_params.t
   branches/context_unify3_simple/t/pmc/callcontext.t
   branches/context_unify3_simple/t/pmc/context.t
   branches/context_unify3_simple/t/pmc/parrotinterpreter.t

Modified: branches/context_unify3_simple/t/op/cc_params.t
==============================================================================
--- branches/context_unify3_simple/t/op/cc_params.t	Sat Dec 19 23:22:03 2009	(r43165)
+++ branches/context_unify3_simple/t/op/cc_params.t	Sat Dec 19 23:25:33 2009	(r43166)
@@ -32,7 +32,7 @@
 .sub call_sig_with_no_args
     .param pmc sig :call_sig
     $S0 = typeof sig
-    is('CallSignature', $S0)
+    is('CallContext', $S0)
     $I0 = elements sig
     is(0, $I0)
 .end
@@ -40,7 +40,7 @@
 .sub call_sig_with_positionals
     .param pmc sig :call_sig
     $S0 = typeof sig
-    is('CallSignature', $S0)
+    is('CallContext', $S0)
     $I0 = elements sig
     is(3, $I0)
     $I1 = sig[0]
@@ -54,7 +54,7 @@
 .sub call_sig_with_named
     .param pmc sig :call_sig
     $S0 = typeof sig
-    is('CallSignature', $S0)
+    is('CallContext', $S0)
     $I0 = elements sig
     is(0, $I0)
     $I1 = sig["x"]
@@ -74,7 +74,7 @@
 
     # Have call sig.
     $S0 = typeof sig
-    is('CallSignature', $S0)
+    is('CallContext', $S0)
 
     # First element is self.
     $P0 = sig[0]
@@ -95,7 +95,7 @@
 
     # Have call sig.
     $S0 = typeof sig
-    is('CallSignature', $S0)
+    is('CallContext', $S0)
 
     # First element is self.
     $P0 = sig[0]

Modified: branches/context_unify3_simple/t/pmc/callcontext.t
==============================================================================
--- branches/context_unify3_simple/t/pmc/callcontext.t	Sat Dec 19 23:22:03 2009	(r43165)
+++ branches/context_unify3_simple/t/pmc/callcontext.t	Sat Dec 19 23:25:33 2009	(r43166)
@@ -4,15 +4,15 @@
 
 =head1 NAME
 
-t/pmc/callsignature.t - test CallSignature PMC
+t/pmc/callcontext.t - test CallContext PMC
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/callsignature.t
+    % prove t/pmc/callcontext.t
 
 =head1 DESCRIPTION
 
-Tests the CallSignature PMC.
+Tests the CallContext PMC.
 
 =cut
 
@@ -33,12 +33,12 @@
 .end
 
 .sub 'test_instantiate'
-    $P0 = new ['CallSignature']
-    ok(1, 'Instantiated CallSignature')
+    $P0 = new ['CallContext']
+    ok(1, 'Instantiated CallContext')
 .end
 
 .sub 'test_get_set_attrs'
-    $P0 = new ['CallSignature']
+    $P0 = new ['CallContext']
     $P5 = new 'String'
 
     $P5 = 'moonbomb'
@@ -55,7 +55,7 @@
 .end
 
 .sub 'test_push_pop_indexed_access'
-    $P0 = new [ 'CallSignature' ]
+    $P0 = new [ 'CallContext' ]
     $P1 = new [ 'Integer' ]
     $P1 = 100
 
@@ -94,7 +94,7 @@
 .end
 
 .sub 'test_shift_unshift_indexed_access'
-    $P0 = new [ 'CallSignature' ]
+    $P0 = new [ 'CallContext' ]
     $P1 = new [ 'Integer' ]
     $P1 = 100
 
@@ -134,7 +134,7 @@
 .end
 
 .sub 'test_indexed_access'
-    $P0    = new [ 'CallSignature' ]
+    $P0    = new [ 'CallContext' ]
     $P0[0] = 100
 
     $I0 = elements $P0
@@ -193,7 +193,7 @@
 .end
 
 .sub 'test_indexed_boxing'
-    $P0    = new [ 'CallSignature' ]
+    $P0    = new [ 'CallContext' ]
     $P0[0] = 100
     $P0[1] = 1.11
 
@@ -234,7 +234,7 @@
 .end
 
 .sub 'test_keyed_access'
-    $P0        = new [ 'CallSignature' ]
+    $P0        = new [ 'CallContext' ]
 
     $P0['foo'] = 100
     $P0['bar'] = 1.11
@@ -262,7 +262,7 @@
 .end
 
 .sub 'test_exists'
-    $P0        = new [ 'CallSignature' ]
+    $P0        = new [ 'CallContext' ]
 
     $P0[0]     = 111
     $P0['foo'] = 100
@@ -281,7 +281,7 @@
 .end
 
 .sub 'test_clone'
-    $P0 = new ['CallSignature']
+    $P0 = new ['CallContext']
     $P0[0] = 42
     $P0[1] = "Hello Parrot"
     $P0['floatval'] = 3.14159

Modified: branches/context_unify3_simple/t/pmc/context.t
==============================================================================
--- branches/context_unify3_simple/t/pmc/context.t	Sat Dec 19 23:22:03 2009	(r43165)
+++ branches/context_unify3_simple/t/pmc/context.t	Sat Dec 19 23:25:33 2009	(r43166)
@@ -4,7 +4,7 @@
 
 =head1 NAME
 
-t/pmc/context.t - test Context PMC
+t/pmc/context.t - test CallContext PMC
 
 =head1 SYNOPSIS
 
@@ -12,9 +12,9 @@
 
 =head1 DESCRIPTION
 
-Tests the Context PMC.
+Tests the CallContext PMC.
 
-TODO: Implement real tests when Context PMC will be migrated to use ATTRibutes.
+TODO: Implement real tests when CallContext PMC will be migrated to use ATTRibutes.
 
 =cut
 
@@ -36,9 +36,9 @@
 .end
 
 .sub 'test_new'
-    $P0 = new ['Context']
+    $P0 = new ['CallContext']
     sweep 1
-    ok(1, 'Instantiated .Context')
+    ok(1, 'Instantiated .CallContext')
 .end
 
 # Put test_inspect into Namespace, as method, with outer, etc.
@@ -58,72 +58,72 @@
 
     $P0 = getinterp
     ctx = $P0['context']
-    $I0 = defined ctx 
-    ok($I0, "Got Context")
+    $I0 = defined ctx
+    ok($I0, "Got CallContext")
 
     # Check current_sub first. Other tests relying on it
-    $P0 = ctx['current_sub']
-    is($P0, 'test_inspect', 'Got Context.current_sub')
+    $P0 = getattribute ctx, 'current_sub'
+    is($P0, 'test_inspect', 'Got CallContext.current_sub')
 
-    $P0 = ctx['caller_ctx']
-    $I0 = isa $P0, 'Context'
-    ok($I0, 'Got Context.caller_ctx')
-    $P0 = $P0['current_sub']
+    $P0 = getattribute ctx, 'caller_ctx'
+    $I0 = isa $P0, 'CallContext'
+    ok($I0, 'Got CallContext.caller_ctx')
+    $P0 = getattribute $P0, 'current_sub'
     is($P0, 'main', '... from proper Sub')
 
-    $P0 = ctx['outer_ctx']
-    $I0 = isa $P0, 'Context'
-    ok($I0, 'Got Context.outer_ctx')
-    $P0 = $P0['current_sub']
+    $P0 = getattribute ctx, 'outer_ctx'
+    $I0 = isa $P0, 'CallContext'
+    ok($I0, 'Got CallContext.outer_ctx')
+    $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')
+    ok($I0, 'Got CallContext.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')
+    ok($I0, 'Got CallContext.current_cont')
 
-    $P0 = ctx['current_object']
+    $P0 = getattribute ctx, 'current_object'
     $I0 = isa $P0, 'Foo'
-    ok($I0, 'Got Context.current_object')
+    ok($I0, 'Got CallContext.current_object')
 
-    $P0 = ctx['current_namespace']
-    ok($P0, 'Got Context.current_namespace')
+    $P0 = getattribute ctx, 'current_namespace'
+    ok($P0, 'Got CallContext.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')
+    is($I0, $I1, 'Got CallContext.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")
+    ok($I0, "No world domination in this CallContext")
 
     # Current HLL shouldn't be zero
-    $P0 = ctx['current_HLL']
+    $P0 = getattribute ctx, 'current_HLL'
     $I0 = $P0
-    ok($I0, 'Got Context.current_HLL')
-    
-    $P0 = ctx['current_hll']
-    ok($P0, 'FOO', 'Got Context.current_hll')
+    ok($I0, 'Got CallContext.current_HLL')
+
+    $P0 = getattribute ctx, 'current_hll'
+    ok($P0, 'FOO', 'Got CallContext.current_hll')
 
   done:
     pop_eh
@@ -136,7 +136,7 @@
     .local pmc bt
     bt = 'test_bt1'()
     $I0 = defined bt
-    ok($I0, "Got Context.backtrace()")
+    ok($I0, "Got CallContext.backtrace()")
 
     # We should have more than 3 elements
     $I0 = elements bt

Modified: branches/context_unify3_simple/t/pmc/parrotinterpreter.t
==============================================================================
--- branches/context_unify3_simple/t/pmc/parrotinterpreter.t	Sat Dec 19 23:22:03 2009	(r43165)
+++ branches/context_unify3_simple/t/pmc/parrotinterpreter.t	Sat Dec 19 23:25:33 2009	(r43166)
@@ -93,7 +93,7 @@
     is($S0, 'bar', 'Got ParrotInterp.annotations')
 
     $P0 = interp['context';0]
-    $I0 = isa $P0, 'Context'
+    $I0 = isa $P0, 'CallContext'
     ok($I0, 'Got ParrotInterp.context')
     # Add more tests for Context. E.g. it is correct Context by inspecting it.
 


More information about the parrot-commits mailing list