在 midje 中发现了一些奇怪的行为,不确定它是否与 midje 相关,或者由于我对某些 clojure 构造的误解,但这令人费解:
在事实语句中,不会调用 for 循环:
(ns t1
(:require [midje.sweet :refer :all ] )
)
(facts
(println "ok") ; -- this prints fine
(for [val '(1 2 3)] (println val)) ; this does not
(fact "junk"
(> (.length "aaaaha") 3) => true ))
认为这可能与 for 在 ns 中被覆盖有关,但调用 clojure.core/for 的行为类似。