test-is

Unable to resolve symbol: is in this context

会有一股神秘感。 提交于 2019-12-12 07:49:50
问题 I'm brand new to Clojure, and I am having a bit of trouble getting unit tests running. (ns com.bluepojo.scratch (:require clojure.test)) (defn add-one ([x] (+ x 1)) ) (is (= (add-one 3) 4)) gives: java.lang.Exception: Unable to resolve symbol: is in this context What am I missing? Update: This works: (clojure.test/is (= (add-one 3) 4)) How do I make it so that I don't have to declare clojure.test before the is? 回答1: Your use of the ns macro is not quite correct and you have several options to

how do i get rid of duplicate clojure test-is unit tests on the REPL

南笙酒味 提交于 2019-12-11 02:13:55
问题 I have a little script (use :reload-all 'com.example.package1 'com.example.package2 'com.example.package3 'com.example.testlib) (run-tests 'com.example.package1 'com.example.package2 'com.example.package3) that I use to quickly reload everything and fire off the unit tests. trouble is that each time (deftest ... ) is evaluated as the files are read an additional test is created so after working hard all day each test is now being run 103 times, eek! 回答1: There is a flag *load-tests* which