+#+ignore
+(progn
+(deftest :dst.1
+ (is-dst-change-usa-spring-utime
+ (encode-universal-time 0 0 0 2 4 2000)) t)
+(deftest :dst.2
+ (is-dst-change-usa-spring-utime
+ (encode-universal-time 0 0 0 1 4 2000)) nil)
+(deftest :dst.3
+ (is-dst-change-usa-spring-utime
+ (encode-universal-time 0 0 0 3 4 2000)) nil)
+(deftest :dst.4
+ (is-dst-change-usa-fall-utime
+ (encode-universal-time 0 0 0 31 10 2004)) t)
+(deftest :dst.5
+ (is-dst-change-usa-fall-utime
+ (encode-universal-time 0 0 0 30 10 2004)) nil)
+(deftest :dst.6
+ (is-dst-change-usa-fall-utime
+ (encode-universal-time 0 0 0 1 11 2000)) nil)
+)
+
+(deftest :sts.1
+ (seconds-to-condensed-time-string 0) "0s")
+(deftest :sts.2
+ (seconds-to-condensed-time-string 60) "1m0s")
+(deftest :sts.3
+ (seconds-to-condensed-time-string 65) "1m5s")
+(deftest :sts.4
+ (seconds-to-condensed-time-string 3600) "1h0m0s")
+(deftest :sts.5
+ (seconds-to-condensed-time-string 36000) "10h0m0s")
+(deftest :sts.6
+ (seconds-to-condensed-time-string 86400) "1d0h0m0s")
+(deftest :sts.7
+ (seconds-to-condensed-time-string (* 7 86400)) "1w0d0h0m0s")
+(deftest :sts.8
+ (seconds-to-condensed-time-string (* 21 86400)) "3w0d0h0m0s")
+(deftest :sts.9
+ (seconds-to-condensed-time-string (+ 86400 7200 120 50 (* 21 86400))) "3w1d2h2m50s")
+(deftest :sts.10
+ (seconds-to-condensed-time-string (+ .1 86400 7200 120 50 (* 21 86400))
+ :dp-digits 1) "3w1d2h2m50.1s")
+
+(deftest :ekdc.1
+ (ensure-keyword-default-case (read-from-string "TYPE")) :type)
+
+(deftest :ekdc.2
+ (ensure-keyword-default-case (read-from-string "type")) :type)
+
+
+(deftest :se.1
+ (string-elide "A Test string" 10 :end) "A Test ..." )
+
+(deftest :se.2
+ (string-elide "A Test string" 13 :end) "A Test string")
+
+(deftest :se.3
+ (string-elide "A Test string" 11 :end) "A Test s..." )
+
+(deftest :se.4
+ (string-elide "A Test string" 2 :middle) "...")
+
+(deftest :se.5
+ (string-elide "A Test string" 11 :middle) "A Te...ring")
+
+(deftest :se.6
+ (string-elide "A Test string" 12 :middle) "A Tes...ring")
+
+(deftest :url.1
+ (make-url "pg")
+ "pg")
+
+(deftest :url.2
+ (make-url "pg" :anchor "now")
+ "pg#now")
+
+(deftest :url.3
+ (make-url "pg" :vars '(("a" . "5")))
+ "pg?a=5")
+
+(deftest :url.4
+ (make-url "pg" :anchor "then" :vars '(("a" . "5") ("b" . "pi")))
+ "pg?a=5&b=pi#then")
+
+(defclass test-unique ()
+ ((a :initarg :a)
+ (b :initarg :b)))
+
+
+(deftest :unique.1
+ (let ((list (list (make-instance 'test-unique :a 1 :b 1)
+ (make-instance 'test-unique :a 2 :b 2)
+ (make-instance 'test-unique :a 3 :b 2))))
+ (values
+ (unique-slot-values list 'a)
+ (unique-slot-values list 'b)))
+ (1 2 3) (1 2))
+
+(deftest :unique.2
+ (unique-slot-values nil 'a)
+ nil)
+
+(deftest :nwp.1
+ (numbers-within-percentage 1. 1.1 9)
+ nil)
+
+(deftest :nwp.2
+ (numbers-within-percentage 1. 1.1 11)
+ t)
+
+(deftest :pfs.1 (prefixed-fixnum-string 0 #\A 5) "A00000")
+
+(deftest :pfs.2 (prefixed-fixnum-string 1 #\A 5) "A00001")
+
+(deftest :pfs.3 (prefixed-fixnum-string 21 #\B 3) "B021")
+
+(deftest :pis.4 (prefixed-integer-string 234134 #\C 7) "C0234134")
+
+;;; Binary tree search tests
+
+(defvar *btree-vector*)
+
+(defun init-btree-vector (len)
+ (make-random-state t)
+ (setq *btree-vector* (make-array (list len)
+ :element-type 'fixnum
+ :initial-element 0))
+ (dotimes (i (length *btree-vector*))
+ (do ((rand (random most-positive-fixnum) (random most-positive-fixnum)))
+ ((not (find rand *btree-vector* :end i))
+ (setf (aref *btree-vector* i) rand))))
+ (setq *btree-vector* (sort *btree-vector* #'<)))
+
+(defun test-btree-vector (len)
+ (init-btree-vector len)
+ (dotimes (i (length *btree-vector*) t)
+ (let ((stored (aref *btree-vector* i)))
+ (multiple-value-bind (pos value last-pos count)
+ (sorted-vector-find stored *btree-vector*)
+ (declare (ignore last-pos))
+ (when (or (not (eql i pos)) (not (eql stored value)))
+ (format t "~&Error: btree value ~D at pos ~D: found ~D at pos ~D [count ~D].~%"
+ stored i value pos count)
+ (return nil))))))
+
+(deftest :btree.1
+ (dotimes (i 1000 t)
+ (test-btree-vector i))
+ t)
+
+(defun time-btree (&optional (fn #'sorted-vector-find) (return-on-error nil))
+ (time
+ (let ((total-count 0))
+ (declare (fixnum total-count))
+ (dotimes (i (length *btree-vector*) t)
+ (let ((stored (aref *btree-vector* i)))
+ (multiple-value-bind (value pos count)
+ (funcall fn stored *btree-vector*)
+ (incf total-count count)
+ (when (or (/= i pos) (/= stored value))
+ (format t "~&Error: btree value ~D at pos ~D: found ~D at pos ~D [count ~D].~%"
+ stored i value pos count)
+ (when return-on-error
+ (return-from time-btree nil))))))
+ (float (/ total-count (length *btree-vector*))))))
+