3
我有可能是最簡單的測試失敗與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