如何在midje测试中表示seq

时间:2013-03-20 11:08:25

标签: clojure

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

1 个答案:

答案 0 :(得分: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

测试了它