0
(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 ?(以上不起作用)

4

1 回答 1

0

以上对我有用,您的断言中的 {: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 测试了它

于 2013-03-20T11:26:37.620 回答