File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 957
957
IEquiv
958
958
(-equiv [o other]
959
959
(and (instance? js/Date other)
960
- (identical? (.toString o) (.toString other)))))
960
+ (== (.valueOf o) (.valueOf other))))
961
+
962
+ IComparable
963
+ (-compare [this other]
964
+ (garray/defaultCompare (.valueOf this) (.valueOf other))))
961
965
962
966
(extend-type number
963
967
IEquiv
Original file line number Diff line number Diff line change 1673
1673
(is (= -1 (compare (subvec [1 2 3 ] 1 ) (subvec [1 2 4 ] 1 ))))
1674
1674
(is (= 0 (compare (subvec [1 2 3 ] 1 ) (subvec [1 2 3 ] 1 ))))
1675
1675
(is (= 1 (compare (subvec [1 2 4 ] 1 ) (subvec [1 2 3 ] 1 )))))
1676
+
1677
+ (is (= 0 (compare (js/Date. 2015 2 8 19 13 00 999 )
1678
+ (js/Date. 2015 2 8 19 13 00 999 ))))
1679
+ (is (= -1 (compare (js/Date. 2015 2 8 19 12 00 999 )
1680
+ (js/Date. 2015 2 8 19 13 00 999 ))))
1681
+ (is (= 1 (compare (js/Date. 2015 2 8 19 14 00 999 )
1682
+ (js/Date. 2015 2 8 19 13 00 999 ))))
1676
1683
)
1677
1684
1678
1685
(deftest test-dot
You can’t perform that action at this time.
0 commit comments