Test diff output breaks when comparing different types of maps
aeriksson opened this issue · comments
André Eriksson commented
Comparing e.g. PersistentArrayMaps to PersistentHashMaps breaks the diff.
As an example, the following test:
(deftest t (testing (is (= {0 0} {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8}))))
gives the following output:
expected: {0 0}
actual: {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8}
diff: - {0 0}
+ {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8}
…while:
(deftest t (testing (is (= {0 0} {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9}))))
gives:
expected: {0 0}
actual: {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9}
expected: {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9} to be an instance of clojure.lang.PersistentArrayMap
was: {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9} is an instance of clojure.lang.PersistentArrayMap
(the difference here being that map literals are interpreted as either hash maps or array maps depending on the number of elements)