From 3002f6bf3cfd820d625512fe5e53f89e1851dbd8 Mon Sep 17 00:00:00 2001 From: Christophe Grand Date: Wed, 9 Oct 2024 14:33:48 +0200 Subject: [PATCH] add assert for main not being an acceptable deftest name. Also rm deadcode. --- clj/src/cljd/test.cljd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clj/src/cljd/test.cljd b/clj/src/cljd/test.cljd index 2a94adec..c947ac5f 100644 --- a/clj/src/cljd/test.cljd +++ b/clj/src/cljd/test.cljd @@ -441,6 +441,8 @@ When *load-tests* is false, deftest is ignored." [name & body] + (assert (not= 'main name) + "Can't use `main` as a test name.") (let [opts (take-while (fn [[k]] (keyword? k)) (partition 2 body)) body (drop (* 2 (count opts)) body) opts (into {} (map vec) opts) @@ -450,7 +452,6 @@ `(do (defn ~(vary-meta name assoc ::test true) [] (let [name# ~(str (:current-ns (:nses &env)) "/" name) - test-called (volatile! false) thunk# (fn [] (let [~runner-args *in-test*]