Skip to content

Commit

Permalink
add assert for main not being an acceptable deftest name. Also rm dea…
Browse files Browse the repository at this point in the history
…dcode.
  • Loading branch information
cgrand committed Oct 9, 2024
1 parent 8421415 commit 3002f6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clj/src/cljd/test.cljd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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*]
Expand Down

0 comments on commit 3002f6b

Please sign in to comment.