[svn:parrot] r40271 - trunk/t/op

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Jul 25 21:32:56 UTC 2009


Author: chromatic
Date: Sat Jul 25 21:32:55 2009
New Revision: 40271
URL: https://trac.parrot.org/parrot/changeset/40271

Log:
[t] Added tests for TT #536, looking up lexical subs.

Modified:
   trunk/t/op/lexicals.t

Modified: trunk/t/op/lexicals.t
==============================================================================
--- trunk/t/op/lexicals.t	Sat Jul 25 21:30:05 2009	(r40270)
+++ trunk/t/op/lexicals.t	Sat Jul 25 21:32:55 2009	(r40271)
@@ -1,5 +1,5 @@
 #!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -14,7 +14,7 @@
 plan( skip_all => 'lexicals not thawed properly from PBC, RT #60652' )
     if $ENV{TEST_PROG_ARGS} =~ /--run-pbc/;
 
-plan( tests => 47 );
+plan( tests => 48 );
 
 =head1 NAME
 
@@ -1465,6 +1465,34 @@
 # ]
 OUTPUT
 
+pir_output_is( <<'CODE', <<'OUTPUT', 'TT #536: lexical sub lookup' );
+.sub 'main'
+    .const 'Sub' $P0 = 'lexfoo'
+    .lex 'foo1', $P0
+    .lex 'foo2', $P0
+
+    'foo1'(1)
+    'foo2'(2)
+.end
+
+.sub 'lexfoo'
+    .param int count
+    print 'ok '
+    print count
+    say ' - looking up lexical sub'
+.end
+
+.sub 'foo2'
+    .param int count
+    print 'not ok '
+    print count
+    say ' - looked up global sub, not lexical'
+.end
+CODE
+ok 1 - looking up lexical sub
+ok 2 - looking up lexical sub
+OUTPUT
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4


More information about the parrot-commits mailing list