kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
rgm 2020-04-21T06:40:58.151100Z

I’m trying to implement my first deftype for physical quantities like 1.0 m**2 (more or less a tuple) and I’m a bit confused about what kaocha’s using to convert it to strings for test reporting. In the initial deftype I’ve implemented toString of Object. It seems to be picking that up in clj but not in cljs:

FAIL in cljs:nzn.esc-targets-test/air-changes-above-6999-hdd-18 (cljs/test.js:424)
Expected:
  #object[opengb.dram.core.Quantity]
Actual:
  #object[opengb.dram.core.Quantity]
Diff:
  - #object[opengb.dram.core.Quantity]
  + #object[opengb.dram.core.Quantity]

FAIL in nzn.esc-targets-test/air-changes-above-6999-hdd-18 (esc_targets_test.cljc:24)
Expected:
  #<opengb.dram.core.Quantity@4198e66b <2.0 ACH>>
Actual:
  -#<opengb.dram.core.Quantity@4198e66b <2.0 ACH>> +#<opengb.dram.core.Quantity@446582b1 <3.0 ACH>>
8 tests, 24 assertions, 2 failures.

rgm 2020-04-21T06:42:27.152400Z

I scanned through cljs core looking for other protocols (eg. I had to flip to IEquiv for equality since equals seems to also be clj only), but nothing hopped out at me.

rgm 2020-04-21T06:47:34.153900Z

I wouldn’t think print-method or print-dup would have much to do with cljs, but I’m always willing to be surprised, I guess.

rgm 2020-04-21T19:32:53.154400Z

hm, doesn’t seem to be IPrintWithWriter either, per https://clojurians.slack.com/archives/C03S1L9DN/p1587494680270400?thread_ts=1587490666.267200&cid=C03S1L9DN