lambdaisland / deep-diff2

Deep diff Clojure data structures and pretty print the result
Eclipse Public License 1.0
296 stars 18 forks source link

Print dates and UUIDs with tagged literals #10

Closed nwjsmith closed 5 years ago

nwjsmith commented 5 years ago

Fixes #9

plexus commented 5 years ago

Thanks, good stuff! I added a tiny nitpick, would you mind changing that? otherwise I'm happy to merge.

nwjsmith commented 5 years ago

@plexus Good catch, added in the character literals to improve the readability. It looks like Clojure prints java.util.Calendars and java.sql.Timestamps as #inst literals too. Should I add print handlers for those?

plexus commented 5 years ago

That'd be great. I'm a bit surprised about Calendar, as it's really a bit of a separate category. java.sql.Timestamp is a subclass of Date so that makes sense, but anyway if that's what Clojure's printer does I guess we can do the same.

nwjsmith commented 5 years ago

@plexus all set

plexus commented 5 years ago

Nice! Will put out a release of deep-diff and kaocha shortly.

plexus commented 5 years ago

Oops, spoke too soon. Seems the generative tests found a problem: https://circleci.com/gh/lambdaisland/deep-diff/65?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

FAIL in lambdaisland.deep-diff.diff-test/round-trip-diff (diff_test.clj:207)
expected: {:result true}
  actual: {:shrunk {:total-nodes-visited 96, :depth 13, :pass? false, :result false, :result-data nil, :time-shrinking-ms 31, :smallest [{##NaN 0} {}]}, :failed-after-ms 90, :num-tests 40, :seed 1554909672622, :fail [{.L-gZA6*FF "\tqñˆIkÉ»y?äbÍà", ##NaN -0.06219482421875, \| 34/23, true \8, 1 #uuid "a2565b7c-d09e-45de-890d-efd8de6c6cc0", :_-/b!3?*?x !*eUdRI/*.*sl?:8} {#uuid "528f95c8-8ab7-4547-b1ad-c7059f45a3f5" :?4, *! -26/15, 354756707 9751, :x0_6_0wR_ -37224235}], :result false, :result-data nil, :failing-size 39, :pass? false, :test-var "round-trip-diff"}

I can't say for sure if this is related to your change. Would you have time to check out what's happening here?

plexus commented 5 years ago

Looking at the output I guess it's due to ##NaN, which isn't your problem. I'm also fine with merging this and making a separate issue for that.