File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1938,6 +1938,7 @@ reduces them without incurring seq initialization"
1938
1938
(cond
1939
1939
(< xl yl) -1
1940
1940
(> xl yl) 1
1941
+ (== xl 0 ) 0
1941
1942
:else (compare-indexed xs ys xl 0 ))))
1942
1943
([xs ys len n]
1943
1944
(let [d (compare (nth xs n) (nth ys n))]
Original file line number Diff line number Diff line change 1679
1679
(is (= 1 (compare [1 2 ] [1 1 ])))
1680
1680
(is (= 1 (compare [1 1 1 ] [1 2 ])))
1681
1681
(is (= 1 (compare [1 1 2 ] [1 1 1 ])))
1682
+ (is (= 0 (compare [] [])))
1683
+ (is (= 0 (compare (vec #js []) [])))
1684
+ (is (= 0 (compare (with-meta [] {}) [])))
1685
+ (is (= 0 (compare (pop [1 ]) [])))
1682
1686
1683
1687
(is (= -1 (compare (subvec [1 2 3 ] 1 ) (subvec [1 2 4 ] 1 ))))
1684
1688
(is (= 0 (compare (subvec [1 2 3 ] 1 ) (subvec [1 2 3 ] 1 ))))
1685
- (is (= 1 (compare (subvec [1 2 4 ] 1 ) (subvec [1 2 3 ] 1 )))))
1689
+ (is (= 1 (compare (subvec [1 2 4 ] 1 ) (subvec [1 2 3 ] 1 ))))
1690
+ (is (= 0 (compare (subvec [1 ] 0 0 ) (subvec [2 ] 0 0 ))))
1686
1691
1687
1692
(is (= 0 (compare (js/Date. 2015 2 8 19 13 00 999 )
1688
1693
(js/Date. 2015 2 8 19 13 00 999 ))))
1689
1694
(is (= -1 (compare (js/Date. 2015 2 8 19 12 00 999 )
1690
1695
(js/Date. 2015 2 8 19 13 00 999 ))))
1691
1696
(is (= 1 (compare (js/Date. 2015 2 8 19 14 00 999 )
1692
1697
(js/Date. 2015 2 8 19 13 00 999 ))))
1693
- )
1698
+ ))
1694
1699
1695
1700
(deftest test-dot
1696
1701
(let [s " abc" ]
You can’t perform that action at this time.
0 commit comments