aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure/contrib')
-rw-r--r--src/clojure/contrib/test_is.clj9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clojure/contrib/test_is.clj b/src/clojure/contrib/test_is.clj
index fcb58029..424188c1 100644
--- a/src/clojure/contrib/test_is.clj
+++ b/src/clojure/contrib/test_is.clj
@@ -240,6 +240,15 @@
(fn [] (test-var (var ~symbol))))))
+(defmacro set-test
+ "Experimental.
+ Sets :test metadata of the named var to a fn with the given body.
+ The var must already exist. Does not modify the value of the var.
+ Note: loses the var's original :line and :arglists metadata."
+ [name & body]
+ `(def ~(with-meta name (assoc ^name :test `(fn [] ~@body)))
+ ~name))
+
;;; RUNNING TESTS