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.
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.
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.
hm, doesn’t seem to be IPrintWithWriter
either, per https://clojurians.slack.com/archives/C03S1L9DN/p1587494680270400?thread_ts=1587490666.267200&cid=C03S1L9DN