2010-01-24 03:28:43 +00:00
|
|
|
(load "about-asserts")
|
|
|
|
|
2010-01-24 16:04:27 +00:00
|
|
|
(defmacro meditate-on
|
2010-01-24 03:28:43 +00:00
|
|
|
"Runs tests but exits if an assertion fails"
|
2010-01-24 16:04:27 +00:00
|
|
|
[test-function]
|
|
|
|
`(try
|
|
|
|
(~test-function)
|
|
|
|
(catch Throwable t#
|
|
|
|
(println (str (:zen (meta #'~test-function)) "\n"
|
|
|
|
(:name (meta #'~test-function))
|
|
|
|
" returned " t#))
|
2010-01-24 03:28:43 +00:00
|
|
|
(System/exit 1))))
|
|
|
|
|
|
|
|
(meditate-on test-truth)
|
|
|
|
(meditate-on test-assert-equality)
|
2010-01-31 16:52:32 +00:00
|
|
|
(meditate-on test-fill-in-values)
|
2010-01-24 03:28:43 +00:00
|
|
|
(println "You have achieved clojure zen. Go out into the universe and spread your newfound knowledge.")
|