Skip to content

A peer-to-peer stack for code collaboration

338 B
Raw Blame
{:module 'prelude/exception
 :doc "Tests for exceptions."
 :exports []}

(:test "catch handles scope correctly"
  ;; Issue #191, catch used to accidentally use the lexical environment of
  ;; the `throw` that generated the exception.
  [ ((fn [body handler] (catch 'any (body) handler)) (fn [] (throw 'foo "foo")) (fn [e] #t)) ==> #t ]
)