Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Diff for maps #53

Merged
merged 1 commit into from
Oct 30, 2013
Merged

Diff for maps #53

merged 1 commit into from
Oct 30, 2013

Conversation

edtsech
Copy link
Contributor

@edtsech edtsech commented Jun 19, 2013

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 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<job id=\"5089\">\n  \t<update id=\"1\">\n    \t<timestamp>2013-05-16 10:37:47</timestamp>\n     \t<status>ERROR</status>\n     \t<description>* callfirewall add/src 777333111 jiz existuje.</description>\n   \t</update>\n</job>"}, :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 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<job id=\"5089\">\n  \t<update id=\"1\">\n    \t<timestamp>2013-05-16 10:37:47</timestamp>\n     \t<status>ERROR</status>\n     \t<description>* callfirewall add/src 777333111 jiz existuje.</description>\n   \t</update>\n</job>"}, :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 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<job id=\"5089\">\n  \t<update id=\"1\">\n    \t<timestamp>2013-05-16 10:37:47</timestamp>\n     \t<status>ERROR</status>\n     \t<description>* callfirewall add/src 777333111 jiz existuje.</description>\n   \t</update>\n</job>"}, :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 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<job id=\"5089\">\n  \t<update id=\"1\">\n    \t<timestamp>2013-05-16 10:37:47</timestamp>\n     \t<status>ERROR</status>\n     \t<description>* callfirewall add/src 777333111 jiz existuje.</description>\n   \t</update>\n</job>"}, :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!

@edtsech edtsech mentioned this pull request Aug 7, 2013
slagyr added a commit that referenced this pull request Oct 30, 2013
@slagyr slagyr merged commit bd56ce4 into slagyr:master Oct 30, 2013
@slagyr
Copy link
Owner

slagyr commented Oct 30, 2013

Thanks for the pull request! Sorry it took so long to merge.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants