[svn:parrot] r37873 - trunk/t/pmc

jonathan at svn.parrot.org jonathan at svn.parrot.org
Thu Apr 2 19:52:10 UTC 2009


Author: jonathan
Date: Thu Apr  2 19:52:09 2009
New Revision: 37873
URL: https://trac.parrot.org/parrot/changeset/37873

Log:
[t] Add test for TT#500 fix.

Modified:
   trunk/t/pmc/sub.t

Modified: trunk/t/pmc/sub.t
==============================================================================
--- trunk/t/pmc/sub.t	Thu Apr  2 19:48:00 2009	(r37872)
+++ trunk/t/pmc/sub.t	Thu Apr  2 19:52:09 2009	(r37873)
@@ -9,7 +9,7 @@
 use Test::More;
 use Parrot::Test::Util 'create_tempfile';
 
-use Parrot::Test tests => 67;
+use Parrot::Test tests => 68;
 use Parrot::Config;
 
 =head1 NAME
@@ -1557,6 +1557,38 @@
 ok
 OUTPUT
 
+pir_output_is( <<'CODE', <<'OUTPUT', 'use of :init sub pointed to by a :outer in compreg' );
+.sub 'comptest'
+    $S0 = <<'PIR'
+.sub 'MAIN'
+    say 'MAIN'
+    .return ()
+.end
+.namespace ['XYZ']
+.sub 'BEGIN' :init
+    say 'XYZ::BEGIN'
+    .return ()
+.end
+.sub 'foo' :outer('BEGIN')
+    say 'XYZ::foo'
+    .return ()
+.end
+PIR
+    $P0 = compreg 'PIR'
+    say "got compiler"
+    $P1 = $P0($S0)
+    say "compiled"
+    $P1()
+    say "lived"
+.end
+CODE
+got compiler
+XYZ::BEGIN
+compiled
+MAIN
+lived
+OUTPUT
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4


More information about the parrot-commits mailing list