[svn:parrot] r46736 - branches/pct_multi_support/t/compilers/pct

bacek at svn.parrot.org bacek at svn.parrot.org
Mon May 17 13:51:57 UTC 2010


Author: bacek
Date: Mon May 17 13:51:56 2010
New Revision: 46736
URL: https://trac.parrot.org/parrot/changeset/46736

Log:
Add test for :multi generating from POST::Sub.

Modified:
   branches/pct_multi_support/t/compilers/pct/post.t

Modified: branches/pct_multi_support/t/compilers/pct/post.t
==============================================================================
--- branches/pct_multi_support/t/compilers/pct/post.t	Mon May 17 13:51:44 2010	(r46735)
+++ branches/pct_multi_support/t/compilers/pct/post.t	Mon May 17 13:51:56 2010	(r46736)
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 use lib qw(t . lib ../lib ../../lib ../../../lib);
-use Parrot::Test tests => 6;
+use Parrot::Test tests => 7;
 
 foreach my $name (qw(Op Ops Sub Label)) {
     my $module = "'POST';'$name'";
@@ -83,6 +83,37 @@
 }
 OUT
 
+pir_output_is( <<'CODE', <<'OUT', 'Generate :multi' );
+.sub _main
+    load_bytecode 'PCT.pbc'
+    load_bytecode 'dumper.pbc'
+    .local pmc node
+    node = new ['POST';'Sub']
+    node.'name'('foo')
+    $P0 = new ['ResizablePMCArray']
+    push $P0, "_"
+    push $P0, "Foo"
+    $P1 = new ['ResizableStringArray']
+    push $P1, "Bar"
+    push $P1, "Baz"
+    push $P0, $P1
+    node.'multi'($P0)
+
+    .local pmc compiler
+    compiler = new ['POST';'Compiler']
+    $S0 = compiler.'to_pir'(node)
+    say $S0
+    .return ()
+.end
+CODE
+
+.namespace []
+.sub "foo"  :subid("post10") :multi(_,["Foo"],["Bar";"Baz"])
+.end
+
+
+OUT
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4


More information about the parrot-commits mailing list