File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -5524,7 +5524,8 @@ reduces them without incurring seq initialization"
55245524
55255525 IFind
55265526 (-find [coll n]
5527- (when (<= end (+ start n))
5527+ (when (and (not (neg? n))
5528+ (< (+ start n) end))
55285529 (-find v (+ start n))))
55295530
55305531 IVector
Original file line number Diff line number Diff line change 3939 (is (= (find [1 2 3 ] 0 ) [0 1 ]))
4040 (is (= (find [1 2 3 ] -1 ) nil ))
4141 (is (= (find [1 2 3 ] js/NaN) nil ))
42- (is (= (find [1 2 3 ] 1.2 ) nil ))
4342 (is (= (find [1 2 3 ] :a ) nil ))
4443 (is (= (find [1 2 3 ] 10 ) nil )))
4544 )
9998 sv2 (subvec [0 1 2 3 ] 1 1 )]
10099 (testing " rseq equality"
101100 (is (= (rseq sv1) '(1 )))
102- (is (nil? (rseq sv2))))))
101+ (is (nil? (rseq sv2)))))
102+ (let [s (subvec [0 1 2 3 ] 0 2 )]
103+ (testing " IFind"
104+ (is (= (find s 0 ) [0 0 ]))
105+ (is (= (find s 1 ) [1 1 ]))
106+ (is (= (find s 2 ) nil ))
107+ (is (= (find s -1 ) nil ))))
108+ )
103109 ))
104110
105111(deftest test-sets
You can’t perform that action at this time.
0 commit comments