What I was really looking for was difform . Using clojure.data/diff nice, but it doesn't work in unit test, where larger structures are compared. Here is an example where data/diff does not work as well as in my opinion:
(defn example [] (let [data [{:foo 1} {:value [{:bar 2}]}]] (diff data [{:value [{:bar 2}]}]) (difform data [{:value [{:bar 2}]}]))) ;; => diff output ;; => [[{:foo 1} {:value [{:bar 2}]}] [{:value [{:bar 2}]}] nil] ;; => difform output [{: - foo 1} {: value [{:bar 2}]}] ;; => nil
Kungi
source share