开发者

Removing defined tests in Clojure REPL

In Clojure, I have decided to move from writing :test metadata elements to using deftest. To see that I have written the deftest correctly, I try reloading and running the tests with a reload in the REPL.

While I don't care about duplicate tests per se, when I remove a test from the source, I would like it removed when I reload the source. Clearing the REPL doesn't remove the tests.

So, How many I remove tests define开发者_Go百科d via deftest from the Clojure REPL


clojure.test finds test vars by reflecting on namespaces, so you can use ns-unmap. For full details, see my earlier answer to a similar question


I don't think you can remove vars one-by-one in clojure (I may be wrong; it seems like a strange oversight if that's true). The easiest way to get rid of old definitions is probably to use remove-ns to get rid of the namespace and then re-evaluate the file / namespace / definitions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜