[svn:parrot] r44213 - in trunk: . t/op

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Sat Feb 20 01:36:22 UTC 2010


Author: dukeleto
Date: Sat Feb 20 01:36:20 2010
New Revision: 44213
URL: https://trac.parrot.org/parrot/changeset/44213

Log:
[t] Add a test file for the errorson opcode with one todo test

Added:
   trunk/t/op/errorson.t   (contents, props changed)
Modified:
   trunk/MANIFEST

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Sat Feb 20 00:13:09 2010	(r44212)
+++ trunk/MANIFEST	Sat Feb 20 01:36:20 2010	(r44213)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Feb 19 04:10:16 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sat Feb 20 01:23:06 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1811,6 +1811,7 @@
 t/op/comp.t                                                 [test]
 t/op/copy.t                                                 [test]
 t/op/debuginfo.t                                            [test]
+t/op/errorson.t                                             [test]
 t/op/exceptions.t                                           [test]
 t/op/exit.t                                                 [test]
 t/op/fetch.t                                                [test]

Added: trunk/t/op/errorson.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/t/op/errorson.t	Sat Feb 20 01:36:20 2010	(r44213)
@@ -0,0 +1,48 @@
+#!parrot
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/op/errorson.t - Test the errorson opcode
+
+=head1 SYNOPSIS
+
+% prove t/op/errorson.t
+
+=head1 DESCRIPTION
+
+Tests that the errorson opcode turns exception-throwing on and off correctly.
+
+=cut
+
+.sub test_main :main
+    .include 'test_more.pir'
+    .include 'errors.pasm'
+
+    plan(1)
+    test_find_name()
+.end
+
+.sub test_find_name
+       errorson .PARROT_ERRORS_GLOBALS_FLAG
+       push_eh myhandler
+       $P0 = find_name "i_better_not_exist_or_this_thing_is_crazy"
+       pop_eh
+       if null $P0 goto wasnull
+       ok(0, "variable not null, must have existed somehow. inconceivable!")
+       .return()
+wasnull:
+       todo(0,'errorson did not throw an exception for calling find_name on an unbound variable with PARROT_ERRORS_GLOBALS_FLAG')
+       .return()
+myhandler:
+       pop_eh
+       ok(1,'errorson threw an exception for calling find_name on an unbound variable with PARROT_ERRORS_GLOBALS_FLAG')
+.end
+
+# Local Variables:
+#   mode: pir
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:


More information about the parrot-commits mailing list