Skip to content

Instantly share code, notes, and snippets.

@mrc
Created October 21, 2010 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrc/638125 to your computer and use it in GitHub Desktop.
Save mrc/638125 to your computer and use it in GitHub Desktop.
(defmacro are (test &rest tests)
"Evaluate a list of tests with (is)"
`(progn
(is ,test)
(unless (null ',tests)
(are ,@tests))))
(deftest test-mult ()
(is (= 1 (multiply 1 1)))
(is (= 6 (multiply:multiply 2 3)))
(is (= 100 (multiply:multiply 10 10)))
(is (= 0 (multiply:multiply 3 0)))
(is (= 0 (multiply:multiply 0 3))))
(deftest test-mult ()
(are (= 1 (multiply 1 1))
(= 6 (multiply:multiply 2 3))
(= 100 (multiply:multiply 10 10))
(= 0 (multiply:multiply 3 0))
(= 0 (multiply:multiply 0 3))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment