[svn:parrot] r39931 - branches/ops_pct/compilers/opsc/t

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Jul 7 13:52:41 UTC 2009


Author: bacek
Date: Tue Jul  7 13:52:40 2009
New Revision: 39931
URL: https://trac.parrot.org/parrot/changeset/39931

Log:
[t] Add more PAST tests

Modified:
   branches/ops_pct/compilers/opsc/t/03-past.t

Modified: branches/ops_pct/compilers/opsc/t/03-past.t
==============================================================================
--- branches/ops_pct/compilers/opsc/t/03-past.t	Tue Jul  7 13:52:05 2009	(r39930)
+++ branches/ops_pct/compilers/opsc/t/03-past.t	Tue Jul  7 13:52:40 2009	(r39931)
@@ -7,21 +7,41 @@
     .include 'test_more.pir'
     load_bytecode 'opsc.pbc'
 
-    plan(1)
+    plan(4)
 
     .local pmc compiler, past
     .local string buf
     buf = <<"END"
+/*
+THE HEADER
+*/
+
 VERSION = PARROT_VERSION;
+
 inline op foo(out INT, in PMC, inconst NUM) :flow :deprecated {
     foo # We don't handle anything in C<body> during parse/past.
 }
 END
 
     compiler = compreg 'Ops'
-    past = compiler.'parse'(buf, 'target'=>'past')
+    past = compiler.'compile'(buf, 'target'=>'past')
     ok(1, "PAST::Node created")
 
+    $P0 = past['header']
+    $S0 = $P0.'inline'()
+    like($S0, 'HEADER', 'Header parsed')
+
+    $P0 = past['ops']
+    $P0 = $P0.'list'()
+    $I0 = $P0
+    is($I0, 1, 'We have 1 op')
+
+    # Check op
+    .local pmc op
+    op = $P0[0]
+    $S0 = op['name']
+    is($S0, 'foo', "Name parsed")
+
 .end
 
 # Don't forget to update plan!


More information about the parrot-commits mailing list