]> gitweb.factorcode.org Git - factor.git/blobdiff - core/continuations/continuations-tests.factor
continuations: new words for ignoring masked errors
[factor.git] / core / continuations / continuations-tests.factor
index 6ea528438ab80e189fab5d40dcdc09e405b3c321..c6acfdda62677ced709eca76b590e5477b824abf 100644 (file)
@@ -1,6 +1,6 @@
-USING: accessors continuations debugger eval io kernel
-kernel.private math memory namespaces sequences tools.test
-vectors words ;
+USING: accessors continuations debugger eval io kernel kernel.private
+math math.ratios memory namespaces sequences tools.test vectors words
+;
 IN: continuations.tests
 
 : (callcc1-test) ( n obj -- n' obj )
@@ -33,6 +33,11 @@ IN: continuations.tests
     "Hello" =
 ] unit-test
 
+{ 4 f } [
+    [ 20 5 / ] [ division-by-zero? ] ignore-error/f
+    [ 20 0 / ] [ division-by-zero? ] ignore-error/f
+] unit-test
+
 "!!! The following error is part of the test" print
 
 { } [ [ 6 [ 12 [ "2 car" ] ] ] print-error ] unit-test