Fix exception handling

This commit is contained in:
Michiel Borkent 2020-03-20 23:44:21 +01:00 committed by GitHub
parent 44471c97ec
commit 9835b02785
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 4 deletions

View file

@ -1 +1 @@
0.0.75 0.0.76

View file

@ -1 +1 @@
0.0.76 0.0.77-SNAPSHOT

2
sci

@ -1 +1 @@
Subproject commit aa73bdef358a089733f9e20b1673c551f3ccdd6b Subproject commit 17b14cae6260ad56a37fb3f46de16255ae90f9b8

View file

@ -228,7 +228,18 @@
(is (= {:result 8080} (bb nil "test/babashka/scripts/tools.cli.bb")))) (is (= {:result 8080} (bb nil "test/babashka/scripts/tools.cli.bb"))))
(deftest try-catch-test (deftest try-catch-test
(is (zero? (bb nil "(try (/ 1 0) (catch ArithmeticException _ 0))")))) (is (zero? (bb nil "(try (/ 1 0) (catch ArithmeticException _ 0))")))
(is (= :got-it (bb nil "
(defn foo []
(throw (java.util.MissingResourceException. \"o noe!\" \"\" \"\")))
(defn bar
[]
(try (foo)
(catch java.util.MissingResourceException _
:got-it)))
(bar)
"))))
(deftest reader-conditionals-test (deftest reader-conditionals-test
(is (= :hello (bb nil "#?(:bb :hello :default :bye)"))) (is (= :hello (bb nil "#?(:bb :hello :default :bye)")))