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 3e9022d commit eeb3791
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/clojure/test_clojure/storm_bodies.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@
[:fn-unwind "Dang" ""]]
(u/capture)) "captured traces should match.")))

(deftest uncached-throw-inner-test
(let [r (try
(b/uncached-throw-inner)
(catch Exception e :throwed))]
(is (= :throwed r) "function should have throwed")
(is (= [[:fn-call "clojure.test-clojure.storm-test-code.bodies" "uncached-throw-inner" [] -1606443558]
[:bind "f" "#object[...]" "3"]
[:expr-exec "#object[...]" "3,2,0"]
[:fn-call "clojure.test-clojure.storm-test-code.bodies" "uncached-throw-inner/inner--GEN-ID" [] -1606443558]
[:fn-unwind "Dang" "3,1,1"]
[:fn-unwind "Dang" ""]]
(u/capture)) "captured traces should match.")))

(deftest letfn-test
(let [r (b/letfn-fn)]
(is (= 5 r) "function return should be right.")
Expand Down
5 changes: 5 additions & 0 deletions test/clojure/test_clojure/storm_test_code/bodies.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
(defn uncached-throw []
(throw (Exception. "Dang")))

(defn uncached-throw-inner []
(let [f (fn inner []
(throw (Exception. "Dang")))]
(f)))

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

0 comments on commit eeb3791

Please sign in to comment.