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"
19381938 (cond
19391939 (< xl yl) -1
19401940 (> xl yl) 1
1941+ (== xl 0 ) 0
19411942 :else (compare-indexed xs ys xl 0 ))))
19421943 ([xs ys len n]
19431944 (let [d (compare (nth xs n) (nth ys n))]
Original file line number Diff line number Diff line change 16791679 (is (= 1 (compare [1 2 ] [1 1 ])))
16801680 (is (= 1 (compare [1 1 1 ] [1 2 ])))
16811681 (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 ]) [])))
16821686
16831687 (is (= -1 (compare (subvec [1 2 3 ] 1 ) (subvec [1 2 4 ] 1 ))))
16841688 (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 ))))
16861691
16871692 (is (= 0 (compare (js/Date. 2015 2 8 19 13 00 999 )
16881693 (js/Date. 2015 2 8 19 13 00 999 ))))
16891694 (is (= -1 (compare (js/Date. 2015 2 8 19 12 00 999 )
16901695 (js/Date. 2015 2 8 19 13 00 999 ))))
16911696 (is (= 1 (compare (js/Date. 2015 2 8 19 14 00 999 )
16921697 (js/Date. 2015 2 8 19 13 00 999 ))))
1693- )
1698+ ))
16941699
16951700(deftest test-dot
16961701 (let [s " abc" ]
You can’t perform that action at this time.
0 commit comments