Skip to content

Commit

Permalink
Add uncached-throw-inner test
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmonettas committed Jan 31, 2024
1 parent 1349021 commit 0974fe0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/cljs/cljs/storm/bodies_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
(is (= [[:fn-call "cljs.storm.tests-code.bodies" "uncached-throw" [] 970185633]
[:expr-exec "#object[...]" "3,1"]
[:fn-unwind "Dang" ""]]
(u/capture)) "captured traces should match.")))

(deftest uncached-throw-inner-test
(let [r (try
(b/uncached-throw-inner)
(catch js/Error e :throwed))]
(is (= :throwed r) "function should have throwed")
(is (= [[:fn-call "cljs.storm.tests-code.bodies" "uncached-throw-inner" [] -599626572]
[:bind "f" "#object[...]" "3"]
[:fn-call "cljs.storm.tests-code.bodies" "inner" [] -599626572]
[:expr-exec "#object[...]" "3,1,1,3,1"]
[:fn-unwind "Dang" "3,1,1"]
[:fn-unwind "Dang" ""]]
(u/capture)) "captured traces should match.")))

(deftest letfn-test
Expand Down
5 changes: 5 additions & 0 deletions src/test/cljs/cljs/storm/tests_code/bodies.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
(defn uncached-throw []
(throw (js/Error. "Dang")))

(defn uncached-throw-inner []
(let [f (fn inner []
(throw (js/Error. "Dang")))]
(f)))

(defn letfn-fn []
(letfn [(square [x]
(* x x))]
Expand Down

0 comments on commit 0974fe0

Please sign in to comment.