Advertisement
Guest User

Untitled

a guest
Jun 10th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (use '[clojure.test :only [deftest testing is run-tests]])
  2.  
  3. (defmacro throws-exception [exp]
  4.   `(is (thrown? Exception ~exp)))
  5.  
  6. ; What i'm hoping is to write this
  7. (deftest my-tests
  8.   (testing "things..."
  9.     (throws-exception (first 'hotdog))))
  10. ; Exception
  11. ; Syntax error compiling at (./basics.clj:30:5).
  12. ; No such var: user/thrown?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement