venantius / ultra

A Leiningen plugin for a superior development environment
Eclipse Public License 1.0
1.24k stars 37 forks source link

Comparisons between PersistentArrayMap and PersistentHashMap should diff on keys, not types #80

Closed venantius closed 6 years ago

venantius commented 6 years ago

At the moment a test that ends up comparing a PersistentHashMap and a PersistentArrayMap won't properly diff on keys, instead providing a class difference error. While it's true that these are different classes, from a Clojure perspective that's not really what's helpful when running tests.

FAIL in (we-can-create-a-person-customer) (customer_test.clj:75)

expected: {:entity_id #uuid "000cd5e7-45c7-419a-b8c8-5ad25b315bd0"}
  actual: {:address "10 Downing Street",
           :city "London",
           :company_name nil,
           :country "UK",
           :date_of_birth #inst "1956-10-01T00:00:00.000-00:00",
           :first_name "Theresa",
           :incorporation_number nil,
           :last_name "May",
           :post_code "SW1A 2AA",
           :type "individual"}

expected: {:address "10 Downing Street",
           :city "London",
           :company_name nil,
           :country "UK",
           :date_of_birth #inst "1956-10-01T00:00:00.000-00:00",
           :first_name "Theresa",
           :incorporation_number nil,
           :last_name "May",
           :post_code "SW1A 2AA",
           :type "individual"} to be an instance of clojure.lang.PersistentArrayMap
     was: {:address "10 Downing Street",
           :city "London",
           :company_name nil,
           :country "UK",
           :date_of_birth #inst "1956-10-01T00:00:00.000-00:00",
           :first_name "Theresa",
           :incorporation_number nil,
           :last_name "May",
           :post_code "SW1A 2AA",
           :type "individual"} is an instance of clojure.lang.PersistentHashMap
venantius commented 6 years ago

For reasons that aren't clear I can't reproduce this anymore. I'm not sure if Ultra was being downgraded to a prior version or what happened. Closing for now.