对于 Clojure 新手来说,我可能遇到了最简单的测试失败,并带有一条相当令人困惑的消息。
(ns leiningen.booltest
(:use clojure.test))
(with-test
(defn bool-function []
(true))
(is (= (bool-function) true))
)
ERROR in (bool-function) (booltest.clj:10)
expected: (= (bool-function) true)
actual: java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn