+ :ok))))
+ (assert (eql 1
+ (funcall (lambda ()
+ (declare (optimize speed))
+ (search #() #(1 1) :start2 1 :end2 1)))))
+ (assert (eql 2
+ (funcall (lambda ()
+ (declare (optimize speed))
+ (search #(1) #(1 1) :start1 1 :start2 2)))))
+ (assert (eql 2
+ (funcall (lambda ()
+ (declare (optimize speed))
+ (search #() #(1 1) :from-end t))))))
+
+(with-test (:name :sort-smoke-test)
+ (flet ((iota (n type &aux (i 0))
+ (map-into (make-sequence type n)
+ (lambda ()
+ (incf i))))
+ (shuffle (n type)
+ (let ((vector (let ((i 0))
+ (map-into (make-array n)
+ (lambda ()
+ (incf i))))))
+ (dotimes (i n (coerce vector type))
+ (let ((j (+ i (random (- n i)))))
+ (rotatef (aref vector i) (aref vector j))))))
+ (sortedp (x)
+ (let* ((nonce (list nil))
+ (prev nonce))
+ (every (lambda (x)
+ (prog1 (or (eql prev nonce)
+ (< prev x))
+ (setf prev x)))
+ x))))
+ (dolist (type '(simple-vector list))
+ (dolist (size '(7 8 9 13 1023 1024 1025 1536))
+ (loop for repeat below 5 do
+ (assert (sortedp
+ (sort (funcall (case repeat
+ (0 #'iota)
+ (1 (lambda (n type)
+ (reverse (iota n type))))
+ (t #'shuffle))
+ size type)
+ #'<))))))))