Advertisement
Guest User

Untitled

a guest
Feb 17th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;; Test that are throws if too few/many values are given
  2. (deftest are-throws-on-arity-mismatch
  3.   ;; No args at all
  4.   (is (thrown? IllegalArgumentException
  5.                (macroexpand-1 '(are [a] (constantly true))))
  6.       "Should error")
  7.   ;; Too many
  8.   (is (thrown? IllegalArgumentException
  9.                (macroexpand-1 '(are [a b] (constantly true)
  10.                                     1 2 3)))
  11.       "Should error")
  12.   ;; Too few
  13.   (is (thrown? IllegalArgumentException
  14.                (macroexpand-1 '(are [a b c] (constantly true)
  15.                                     1 2)))
  16.       "Should error"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement