(fact "Checking :time has been removed"
(remove-date [{:time 1 :a 2} {:c 3 :time 4}]) => (seq '({:a 2} {:c 4})))
在上面的测试中,remove-date
函数返回一个 seq({:a 2} {:c 4})
我如何表示右手边的 seq ?(以上不起作用)
(fact "Checking :time has been removed"
(remove-date [{:time 1 :a 2} {:c 3 :time 4}]) => (seq '({:a 2} {:c 4})))
在上面的测试中,remove-date
函数返回一个 seq({:a 2} {:c 4})
我如何表示右手边的 seq ?(以上不起作用)
以上对我有用,您的断言中的 {:c 4} 错误。它应该是 {:c 3}。
(fact "Checking :time has been removed"
(remove-date [{:time 1 :a 2} {:c 3 :time 4}]) => (seq '({:a 2} {:c 3})))
实际上,您不需要seq
调用:
(fact "Checking :time has been removed"
(remove-date [{:time 1 :a 2} {:c 3 :time 4}]) => '({:a 2} {:c 3}))
我用 midje 1.5.0 和 clojure 1.4.0 测试了它