From: jerry gay <[EMAIL PROTECTED]>
   Date: Sat, 14 Jan 2006 08:45:50 -0800

   On 1/13/06, Bob Rogers <[EMAIL PROTECTED]> wrote:
   > still in progress).  Unless somebody would like to see a patch with just
   > the test cases, both marked 'TODO'?

   what's a 0.4.1 release without some TODO tests? the more the better.
   ~jerry

Foolish question, I suppose.  On the other hand, who knows when someone
might say, "Hey, that's not a bug; I need that!" . . .

                                        -- Bob

Index: t/pmc/exception.t
===================================================================
--- t/pmc/exception.t   (revision 11168)
+++ t/pmc/exception.t   (working copy)
@@ -6,7 +6,7 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test tests => 26;
+use Parrot::Test tests => 28;
 
 =head1 NAME
 
@@ -591,3 +591,50 @@
 Error: something happened
 Outer value
 OUTPUT
+
+{
+    # clear_eh should insist on a sub from the current context at TOS.
+    local $TODO = 'bug';
+
+pir_output_like(<<'CODE', <<'OUTPUT', 'clear_eh out of context (1)');
+.sub main :main
+       pushmark 1
+       clear_eh
+       print "no exceptions.\n"
+.end
+CODE
+/No exception to pop./
+OUTPUT
+
+pir_output_is(<<'CODE', <<'OUTPUT', 'clear_eh out of context (2)');
+.sub main :main
+       .local pmc outer, cont
+       push_eh handler
+       test1()
+       print "skipped.\n"
+       goto done
+handler:
+       .local pmc exception
+       .get_results (exception)
+       print "Error: "
+       print exception
+       print "\n"
+done:
+       print "done.\n"
+.end
+.sub test1
+       .local pmc exit
+       print "[in test1]\n"
+       ## clear_eh is illegal here, and signals an exception.
+       clear_eh
+       print "[cleared]\n"
+.end
+CODE
+[in test1]
+Error: No exception to pop.
+done.
+OUTPUT
+
+$TODO = '';    # suppress warning.
+
+} # end $TODO

Reply via email to