slagyr/speclj — pull request #53 by edtsech (2013-06-19 13:17:41+00:00)
Title: Diff for maps

I've added diffs for map. Not the best solution because we compare maps as well as other data structures twice because we call `-coll-difference` twice, but it can be improved in future.

Current state:
```
Expected contents: {:date "10. 10. 2013 8:01", :type "Vol�n�", :description "d�lka hovoru 0:05", :income false, :absolute-price "1 000"}
got: {:date "10. 10. 2013 8:10", :type "Vol�n�", :description "d�lka hovoru 0:05", :income false, :absolute-price "1 000"}
missing: [[:date "10. 10. 2013 8:01"]]
extra: [[:date "10. 10. 2013 8:10"]]

Expected contents: {:errors ["* callfirewall add/src 777333111 jiz existuje."], :response {:status 200, :body "\n\n \t\n \t2013-05-16 10:37:47\n \tERROR\n \t* callfirewall add/src 777333111 jiz existuje.\n \t\n"}, :parsed-body {:content [{:content [{:content ["2013-05-16 10:37:47"], :attrs nil, :tag :timestamp} {:content ["OK"], :attrs nil, :tag :status} {:content ["* callfirewall add/src 777333111 jiz existuje."], :attrs nil, :tag :description}], :attrs {:id "1"}, :tag :update}], :attrs {:id "5089"}, :tag :job}}
got: {:errors ["* callfirewall add/src 777333111 jiz existuje."], :response {:status 200, :body "\n\n \t\n \t2013-05-16 10:37:47\n \tERROR\n \t* callfirewall add/src 777333111 jiz existuje.\n \t\n"}, :parsed-body {:tag :job, :attrs {:id "5089"}, :content [{:tag :update, :attrs {:id "1"}, :content [{:tag :timestamp, :attrs nil, :content ["2013-05-16 10:37:47"]} {:tag :status, :attrs nil, :content ["ERROR"]} {:tag :description, :attrs nil, :content ["* callfirewall add/src 777333111 jiz existuje."]}]}]}}
missing: [[:parsed-body {:content [{:content [{:content ["2013-05-16 10:37:47"], :attrs nil, :tag :timestamp} {:content ["OK"], :attrs nil, :tag :status} {:content ["* callfirewall add/src 777333111 jiz existuje."], :attrs nil, :tag :description}], :attrs {:id "1"}, :tag :update}], :attrs {:id "5089"}, :tag :job}]]
extra: [[:parsed-body {:tag :job, :attrs {:id "5089"}, :content [{:tag :update, :attrs {:id "1"}, :content [{:tag :timestamp, :attrs nil, :content ["2013-05-16 10:37:47"]} {:tag :status, :attrs nil, :content ["ERROR"]} {:tag :description, :attrs nil, :content ["* callfirewall add/src 777333111 jiz existuje."]}]}]}]]
```

New state
```
Expected contents: {:date "10. 10. 2013 8:01", :type "Vol�n�", :description "d�lka hovoru 0:05", :income false, :absolute-price "1 000"}
got: {:date "10. 10. 2013 8:10", :type "Vol�n�", :description "d�lka hovoru 0:05", :income false, :absolute-price "1 000"}
missing: {:date "10. 10. 2013 8:01"}
extra: {:date "10. 10. 2013 8:10"}

Expected contents: {:errors ["* callfirewall add/src 777333111 jiz existuje."], :response {:status 200, :body "\n\n \t\n \t2013-05-16 10:37:47\n \tERROR\n \t* callfirewall add/src 777333111 jiz existuje.\n \t\n"}, :parsed-body {:content [{:content [{:content ["2013-05-16 10:37:47"], :attrs nil, :tag :timestamp} {:content ["OK"], :attrs nil, :tag :status} {:content ["* callfirewall add/src 777333111 jiz existuje."], :attrs nil, :tag :description}], :attrs {:id "1"}, :tag :update}], :attrs {:id "5089"}, :tag :job}}
got: {:errors ["* callfirewall add/src 777333111 jiz existuje."], :response {:status 200, :body "\n\n \t\n \t2013-05-16 10:37:47\n \tERROR\n \t* callfirewall add/src 777333111 jiz existuje.\n \t\n"}, :parsed-body {:tag :job, :attrs {:id "5089"}, :content [{:tag :update, :attrs {:id "1"}, :content [{:tag :timestamp, :attrs nil, :content ["2013-05-16 10:37:47"]} {:tag :status, :attrs nil, :content ["ERROR"]} {:tag :description, :attrs nil, :content ["* callfirewall add/src 777333111 jiz existuje."]}]}]}}
missing: {:parsed-body {:content [{:content [nil {:content ["OK"]}]}]}}
extra: {:parsed-body {:content [{:content [nil {:content ["ERROR"]}]}]}}
```

Thanks!