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

NotFound at svn.parrot.org NotFound at svn.parrot.org
Wed Aug 25 09:11:12 UTC 2010


Author: NotFound
Date: Wed Aug 25 09:11:12 2010
New Revision: 48651
URL: https://trac.parrot.org/parrot/changeset/48651

Log:
some improvement in exception/exceptionhandler tests

Modified:
   trunk/t/pmc/exception.t
   trunk/t/pmc/exceptionhandler.t

Modified: trunk/t/pmc/exception.t
==============================================================================
--- trunk/t/pmc/exception.t	Wed Aug 25 08:31:02 2010	(r48650)
+++ trunk/t/pmc/exception.t	Wed Aug 25 09:11:12 2010	(r48651)
@@ -20,7 +20,7 @@
 
 .sub main :main
     .include 'test_more.pir'
-    plan(24)
+    plan(23)
     test_bool()
     test_int()
     test_attrs()
@@ -34,25 +34,15 @@
 .end
 
 .sub test_bool
-    $P0 = new 'ExceptionHandler'
-    set_addr $P0, _handler
-    ok($P0,'ExceptionHandler object return true')
     $P1 = new 'Exception'
     ok($P1,'Exception object return true')
-    .return()
-  _handler:
-    say "howdy bool!"
 .end
 
 .sub test_int
-    $P0 = new 'ExceptionHandler'
-    set_addr $P0, _handler
-    push_eh $P0
+    $P0 = new 'Exception'
+    $P0 = 42
     $I0 = $P0
-    ok(1,'get_integer on ExceptionHandler ')
-    .return()
-  _handler:
-    say "howdy int!"
+    is($I0, 42, 'set/get integer on Exception')
 .end
 
 .sub test_attrs

Modified: trunk/t/pmc/exceptionhandler.t
==============================================================================
--- trunk/t/pmc/exceptionhandler.t	Wed Aug 25 08:31:02 2010	(r48650)
+++ trunk/t/pmc/exceptionhandler.t	Wed Aug 25 09:11:12 2010	(r48651)
@@ -23,7 +23,10 @@
     .include 'test_more.pir'
 
     # If test exited with "bad plan" MyHandlerCan.can_handle wasn't invoked.
-    plan(15)
+    plan(18)
+
+    test_bool()
+    test_int()
 
     .local pmc eh, eh2
     eh = new ['ExceptionHandler']
@@ -136,6 +139,26 @@
     ok($I0, 'Exception Handler subclass catch exception')
 .end
 
+.sub test_bool
+    $P0 = new 'ExceptionHandler'
+    nok($P0,'ExceptionHandler without address is false')
+    set_addr $P0, _handler
+    ok($P0,'ExceptionHandler with address is true')
+  _handler:
+.end
+
+.sub test_int
+    $P0 = new 'ExceptionHandler'
+    set_addr $P0, _handler
+    push_eh $P0
+    $I0 = $P0
+    ok(1,'get_integer on ExceptionHandler ')
+    .return()
+  _handler:
+    say "howdy int!"
+.end
+
+
 .sub subclass_exception_handler
     .local pmc myhandler
     myhandler = subclass 'ExceptionHandler', [ 'MyHandler' ]


More information about the parrot-commits mailing list