Fix tick.core/micros for negative durations (#208)#209
Fix tick.core/micros for negative durations (#208)#209henryw374 merged 4 commits intojuxt:masterfrom
Conversation
Also fixes truncation bug in the :cljs branch
|
couple of failing tests there. ... and yes, that other test could have a t/with-clock around it to make it work |
|
oops, I didn't think to run cljs tests locally, and attempting to run (I use ungoogled-chromium 😬) But in any case looking at the CI test failure it seems to be an underlying inconsistency between js-joda and java-time? The failing tests are (is (= -1 (t/millis (t/of-nanos -1999999))))
(is (= -1 (t/millis (t/of-micros -1001))))where clj returns -1, cljs returns -2. I believe that means the following also returns different results depending on platform? (I don't have a cljs dev setup at hand to test with) Would you rather I fix it by wrapping in a reader conditional #?(:clj -1 :cljs -2) or remove the block of tests entirely (punting semantic quirks to upstream libs) |
|
hmm. tricky. fix it by wrapping in a reader conditional #?(:clj -1 :cljs -2) I think. please just add a comment that this is discrepancy from underlying lib |
|
ok pushed along with the with-clock fix, let me know if you prefer the commits squashed |
|
looks good. thanks |
Closes #208.
(Side note: I had an unrelated test failure here
tick/test/tick/api_test.cljc
Lines 37 to 38 in bd2eefd
which seems to be a faullty test? The t/date conversion depends on ambient clock / timezone, which in my case happened to return #time/date "2018-01-12")