Created
September 16, 2014 23:24
-
-
Save AlexBaranosky/390ac38336d6ad70d291 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro doseq-tests | |
"Labels each case with an test-num starting from one." | |
[bindings & body] | |
`(let [test-num# (atom 0) | |
bindings-vec# '~(vec (first (rest bindings)))] | |
(doseq ~bindings | |
(testing (str "\n #" @test-num# ": " (get bindings-vec# @test-num#)) | |
(swap! test-num# inc) | |
~@body)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment