[svn:parrot] r41676 - trunk/t/pmc
dukeleto at svn.parrot.org
dukeleto at svn.parrot.org
Sun Oct 4 08:21:54 UTC 2009
Author: dukeleto
Date: Sun Oct 4 08:21:54 2009
New Revision: 41676
URL: https://trac.parrot.org/parrot/changeset/41676
Log:
[t] Convert some exception tests to PIR
Modified:
trunk/t/pmc/exception-old.t
trunk/t/pmc/exception.t
Modified: trunk/t/pmc/exception-old.t
==============================================================================
--- trunk/t/pmc/exception-old.t Sun Oct 4 08:16:22 2009 (r41675)
+++ trunk/t/pmc/exception-old.t Sun Oct 4 08:21:54 2009 (r41676)
@@ -6,7 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 30;
+use Parrot::Test tests => 28;
=head1 NAME
@@ -22,22 +22,6 @@
=cut
-pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw, PMC exception handler" );
- print "main\n"
- new P20, ['ExceptionHandler']
- set_addr P20, _handler
- push_eh P20
- new P30, ['Exception']
- throw P30
- print "not reached\n"
- end
-_handler:
- print "caught it\n"
- end
-CODE
-main
-caught it
-OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "get_results" );
print "main\n"
@@ -340,17 +324,6 @@
something happened
OUTPUT
-pasm_output_is( <<'CODE', <<OUT, "die" );
- push_eh _handler
- die 3, 100
- print "not reached\n"
- end
-_handler:
- print "caught it\n"
- end
-CODE
-caught it
-OUT
pasm_output_is( <<'CODE', <<OUT, "die, error, severity" );
push_eh _handler
Modified: trunk/t/pmc/exception.t
==============================================================================
--- trunk/t/pmc/exception.t Sun Oct 4 08:16:22 2009 (r41675)
+++ trunk/t/pmc/exception.t Sun Oct 4 08:21:54 2009 (r41676)
@@ -18,13 +18,35 @@
.sub main :main
.include 'test_more.pir'
- plan( 12 )
+ plan( 14 )
test_bool()
test_int()
test_attrs()
test_push_pop_eh()
test_push_pop_eh_long()
test_push_eh_throw()
+ test_die()
+ test_throw_obj()
+.end
+
+.sub test_throw_obj
+ new $P20, ['ExceptionHandler']
+ set_addr $P20, _handler
+ push_eh $P20
+ new $P30, ['Exception']
+ throw $P30
+ say "not reached"
+_handler:
+ ok(1,'caught exception object thrown')
+.end
+
+.sub test_die
+ push_eh handler
+ die 3, 100
+ say "not reached"
+ .return()
+handler:
+ ok(1,'die works')
.end
.sub test_push_pop_eh
More information about the parrot-commits
mailing list