Commit 1d9c754d authored by pfdietz's avatar pfdietz

Spruced up order/number of evaluation tests, fixed some test names.

parent bd1d60ba
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((0 0)(0 1)))
(deftest bit-and.20
(deftest bit-and.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((0 0)(1 0)))
(deftest bit-andc1.20
(deftest bit-andc1.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((0 1)(0 0)))
(deftest bit-andc2.20
(deftest bit-andc2.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -219,7 +219,7 @@
#2a((0 0)(1 1))
#2a((1 0)(0 1)))
(deftest bit-eqv.20
(deftest bit-eqv.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((0 1)(1 1)))
(deftest bit-ior.20
(deftest bit-ior.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((1 1)(1 0)))
(deftest bit-nand.20
(deftest bit-nand.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((1 0)(0 0)))
(deftest bit-nor.20
(deftest bit-nor.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -119,6 +119,14 @@
#2a((0 1)(1 0))
#2a((1 0)(0 1)))
(deftest bit-not.order.1
(let ((a (copy-seq #*001101))
(i 0) x)
(values
(bit-not (progn (setf x (incf i)) a))
i x))
#*110010 1 1)
;;; Error tests
(deftest bit-not.error.1
......
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((1 0)(1 1)))
(deftest bit-orc1.20
(deftest bit-orc1.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((1 1)(0 1)))
(deftest bit-orc2.20
(deftest bit-orc2.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -53,6 +53,23 @@
always (if p1 p2 (not p2)))
t)
(deftest bit-vector-p.order.1
(let ((i 0) x)
(values
(notnot (bit-vector-p (progn (setf x (incf i)) #*0010)))
i x))
t 1 1)
(deftest bit-vector-p.order.2
(let ((i 0) x)
(values
(bit-vector-p (progn (setf x (incf i)) 'a))
i x))
nil 1 1)
(deftest bit-vector-p.error.1
(classify-error (bit-vector-p))
program-error)
......
......@@ -218,7 +218,7 @@
#2a((0 0)(1 1))
#2a((0 1)(1 0)))
(deftest bit-xor.20
(deftest bit-xor.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
(x 0) y z)
......
......@@ -111,7 +111,7 @@
;;; Order of evaluation tests
(deftest bit.9
(deftest bit.order.1
(let ((x 0) y z
(b (copy-seq #*01010)))
(values
......@@ -120,7 +120,7 @@
x y z))
1 2 1 2)
(deftest bit.10
(deftest bit.order.2
(let ((x 0) y z w
(b (copy-seq #*01010)))
(values
......
......@@ -46,3 +46,11 @@
(deftest boundp.4
(boundp '#:foo)
nil)
(deftest boundp.order.1
(let ((i 0) x)
(values
(boundp (progn (setf x (incf i)) '#:foo))
i x))
nil 1 1)
......@@ -14,6 +14,7 @@
(deftest cell-error-name.2
(handler-case
(eval '(my-undefined-function))
;; (warning (c) (muffle-warning c))
(cell-error (c) (cell-error-name c)))
my-undefined-function)
......@@ -28,6 +29,15 @@
(deftest cell-error-name.5
(cell-error-name (make-condition 'unbound-slot :name 's))
s)
(deftest cell-error-name.6
(let ((i 0))
(values
(cell-error-name (progn (incf i) (make-condition
'unbound-slot :name 's)))
i))
s 1)
;;; Need test raising condition unbound-slot
......
......@@ -35,7 +35,19 @@
#'(lambda (c1 c2) (not (char= c1 c2))))
t)
(deftest char=.5
(deftest char=.order.1
(let ((i 0))
(values (not (char= (progn (incf i) #\a))) i))
nil 1)
(deftest char=.order.2
(let ((i 0) a b)
(values (char= (progn (setf a (incf i)) #\a)
(progn (setf b (incf i)) #\b))
i a b))
nil 2 1 2)
(deftest char=.order.3
(let ((i 0) a b c)
(values
(char= (progn (setq a (incf i)) #\a)
......@@ -44,6 +56,8 @@
i a b c))
nil 3 1 2 3)
;;;
(deftest char/=.1
(is-ordered-by +code-chars+ #'char/=)
t)
......@@ -61,7 +75,19 @@
(is-ordered-by +rev-code-chars+ #'char/=)
t)
(deftest char/=.5
(deftest char/=.order.1
(let ((i 0))
(values (not (char/= (progn (incf i) #\a))) i))
nil 1)
(deftest char/=.order.2
(let ((i 0) a b)
(values (not (char/= (progn (setf a (incf i)) #\a)
(progn (setf b (incf i)) #\b)))
i a b))
nil 2 1 2)
(deftest char/=.order.3
(let ((i 0) a b c)
(values
(char/= (progn (setq a (incf i)) #\a)
......@@ -70,6 +96,8 @@
i a b c))
nil 3 1 2 3)
;;;
(deftest char<=.1
(loop for c across +code-chars+
always (char<= c c))
......@@ -103,7 +131,19 @@
(notnot-mv (or (char<= #\9 #\a) (char<= #\z #\0)))
t)
(deftest char<=.9
(deftest char<=.order.1
(let ((i 0))
(values (not (char<= (progn (incf i) #\a))) i))
nil 1)
(deftest char<=.order.2
(let ((i 0) a b)
(values (not (char<= (progn (setf a (incf i)) #\a)
(progn (setf b (incf i)) #\b)))
i a b))
nil 2 1 2)
(deftest char<=.order.3
(let ((i 0) a b c)
(values
(char<= (progn (setq a (incf i)) #\a)
......@@ -112,6 +152,8 @@
i a b c))
nil 3 1 2 3)
;;;
(deftest char<.1
(loop for c across +code-chars+
never (char< c c))
......@@ -145,7 +187,19 @@
(notnot-mv (or (char< #\9 #\a) (char< #\z #\0)))
t)
(deftest char<.9
(deftest char<.order.1
(let ((i 0))
(values (not (char< (progn (incf i) #\a))) i))
nil 1)
(deftest char<.order.2
(let ((i 0) a b)
(values (not (char< (progn (setf a (incf i)) #\a)
(progn (setf b (incf i)) #\b)))
i a b))
nil 2 1 2)
(deftest char<.order.3
(let ((i 0) a b c)
(values
(char< (progn (setq a (incf i)) #\a)
......@@ -154,6 +208,17 @@
i a b c))
nil 3 1 2 3)
(deftest char<.order.4
(let ((i 0) a b c)
(values
(char< (progn (setq a (incf i)) #\b)
(progn (setq b (incf i)) #\a)
(progn (setq c (incf i)) #\b))
i a b c))
nil 3 1 2 3)
;;;
(deftest char>=.1
(loop for c across +code-chars+
always (char>= c c))
......@@ -187,7 +252,19 @@
(notnot-mv (or (char>= #\a #\9) (char>= #\0 #\z)))
t)
(deftest char>=.9
(deftest char>=.order.1
(let ((i 0))
(values (not (char>= (progn (incf i) #\a))) i))
nil 1)
(deftest char>=.order.2
(let ((i 0) a b)
(values (not (char>= (progn (setf a (incf i)) #\b)
(progn (setf b (incf i)) #\a)))
i a b))
nil 2 1 2)
(deftest char>=.order.3
(let ((i 0) a b c)
(values
(char>= (progn (setq a (incf i)) #\b)
......@@ -196,6 +273,17 @@
i a b c))
nil 3 1 2 3)
(deftest char>=.order.4
(let ((i 0) a b c)
(values
(char>= (progn (setq a (incf i)) #\a)
(progn (setq b (incf i)) #\b)
(progn (setq c (incf i)) #\a))
i a b c))
nil 3 1 2 3)
;;;
(deftest char>.1
(loop for c across +code-chars+
never (char> c c))
......@@ -229,7 +317,19 @@
(notnot-mv (or (char> #\a #\9) (char> #\0 #\z)))
t)
(deftest char>.9
(deftest char>.order.1
(let ((i 0))
(values (not (char> (progn (incf i) #\a))) i))
nil 1)
(deftest char>.order.2
(let ((i 0) a b)
(values (not (char> (progn (setf a (incf i)) #\b)
(progn (setf b (incf i)) #\a)))
i a b))
nil 2 1 2)
(deftest char>.order.3
(let ((i 0) a b c)
(values
(char> (progn (setq a (incf i)) #\b)
......@@ -238,6 +338,15 @@
i a b c))
nil 3 1 2 3)
(deftest char>.order.4
(let ((i 0) a b c)
(values
(char> (progn (setq a (incf i)) #\a)
(progn (setq b (incf i)) #\b)
(progn (setq c (incf i)) #\a))
i a b c))
nil 3 1 2 3)
;;; Case-insensitive comparisons
(deftest char-equal.1
......@@ -266,7 +375,19 @@
(not (char-equal c1 c2)))))
t)
(deftest char-equal.5
(deftest char-equal.order.1
(let ((i 0))
(values (not (char-equal (progn (incf i) #\a))) i))
nil 1)
(deftest char-equal.order.2
(let ((i 0) a b)
(values (char-equal (progn (setf a (incf i)) #\b)
(progn (setf b (incf i)) #\a))
i a b))
nil 2 1 2)
(deftest char-equal.order.3
(let ((i 0) a b c)
(values
(char-equal (progn (setq a (incf i)) #\a)
......@@ -275,6 +396,17 @@
i a b c))
nil 3 1 2 3)
(deftest char-equal.order.4
(let ((i 0) a b c)
(values
(char-equal (progn (setq a (incf i)) #\a)
(progn (setq b (incf i)) #\b)
(progn (setq c (incf i)) #\a))
i a b c))
nil 3 1 2 3)
;;;
(deftest char-not-equal.1
(is-ordered-by +code-chars+ #'(lambda (c1 c2)
(or (char= (char-downcase c1)
......@@ -298,7 +430,19 @@
(char-not-equal c1 c2))))
t)
(deftest char-not-equal.5
(deftest char-not-equal.order.1
(let ((i 0))
(values (not (char-not-equal (progn (incf i) #\a))) i))
nil 1)
(deftest char-not-equal.order.2
(let ((i 0) a b)
(values (not (char-not-equal (progn (setf a (incf i)) #\b)
(progn (setf b (incf i)) #\a)))
i a b))
nil 2 1 2)
(deftest char-not-equal.order.3
(let ((i 0) a b c)
(values
(char-not-equal (progn (setq a (incf i)) #\a)
......@@ -307,6 +451,17 @@
i a b c))
nil 3 1 2 3)
(deftest char-not-equal.order.4
(let ((i 0) a b c)
(values
(char-not-equal (progn (setq a (incf i)) #\a)
(progn (setq b (incf i)) #\a)
(progn (setq c (incf i)) #\b))
i a b c))
nil 3 1 2 3)
;;;
(deftest char-not-greaterp.1
(loop for c across +code-chars+
always (char-not-greaterp c c))
......@@ -340,7 +495,19 @@
(notnot-mv (or (char-not-greaterp #\9 #\a) (char-not-greaterp #\z #\0)))
t)
(deftest char-not-greaterp.9
(deftest char-not-greaterp.order.1
(let ((i 0))
(values (not (char-not-greaterp (progn (incf i) #\a))) i))
nil 1)
(deftest char-not-greaterp.order.2
(let ((i 0) a b)
(values (not (char-not-greaterp (progn (setf a (incf i)) #\a)
(progn (setf b (incf i)) #\b)))
i a b))
nil 2 1 2)
(deftest char-not-greaterp.order.3
(let ((i 0) a b c)
(values
(char-not-greaterp (progn (setq a (incf i)) #\a)
......@@ -349,6 +516,17 @@
i a b c))
nil 3 1 2 3)
(deftest char-not-greaterp.order.4
(let ((i 0) a b c)
(values
(char-not-greaterp (progn (setq a (incf i)) #\b)
(progn (setq b (incf i)) #\a)
(progn (setq c (incf i)) #\a))
i a b c))
nil 3 1 2 3)
;;;
(deftest char-lessp.1
(loop for c across +code-chars+
never (char-lessp c c))
......@@ -382,7 +560,19 @@
(notnot-mv (or (char-lessp #\9 #\a) (char-lessp #\z #\0)))
t)
(deftest char-lessp.9
(deftest char-lessp.order.1
(let ((i 0))
(values (not (char-lessp (progn (incf i) #\a))) i))
nil 1)
(deftest char-lessp.order.2
(let ((i 0) a b)
(values (not (char-lessp (progn (setf a (incf i)) #\a)
(progn (setf b (incf i)) #\b)))
i a b))
nil 2 1 2)
(deftest char-lessp.order.3
(let ((i 0) a b c)
(values
(char-lessp (progn (setq a (incf i)) #\a)
......@@ -391,6 +581,17 @@
i a b c))
nil 3 1 2 3)
(deftest char-lessp.order.4
(let ((i 0) a b c)
(values
(char-lessp (progn (setq a (incf i)) #\b)
(progn (setq b (incf i)) #\a)
(progn (setq c (incf i)) #\a))
i a b c))
nil 3 1 2 3)
;;;
(deftest char-not-lessp.1
(loop for c across +code-chars+
always (char-not-lessp c c))
......@@ -425,7 +626,19 @@
(notnot-mv (or (char-not-lessp #\a #\9) (char-not-lessp #\0 #\z)))
t)
(deftest char-not-lessp.9
(deftest char-not-lessp.order.1
(let ((i 0))
(values (not (char-not-lessp (progn (incf i) #\a))) i))
nil 1)
(deftest char-not-lessp.order.2
(let ((i 0) a b)
(values (not (char-not-lessp (progn (setf a (incf i)) #\b)
(progn (setf b (incf i)) #\a)))
i a b))
nil 2 1 2)
(deftest char-not-lessp.order.3
(let ((i 0) a b c)
(values
(char-not-lessp (progn (setq a (incf i)) #\b)
......@@ -434,6 +647,17 @@
i a b c))
nil 3 1 2 3)
(deftest char-not-lessp.order.4
(let ((i 0) a b c)
(values
(char-not-lessp (progn (setq a (incf i)) #\a)
(progn (setq b (incf i)) #\b)
(progn (setq c (incf i)) #\b))
i a b c))
nil 3 1 2 3)
;;;
(deftest char-greaterp.1
(loop for c across +code-chars+
never (char-greaterp c c))
......@@ -468,7 +692,19 @@
(notnot-mv (or (char-greaterp #\a #\9) (char-greaterp #\0 #\z)))
t)
(deftest char-greaterp.9
(deftest char-greaterp.order.1
(let ((i 0))
(values (not (char-greaterp (progn (incf i) #\a))) i))
nil 1)
(deftest char-greaterp.order.2
(let ((i 0) a b)
(values (not (char-greaterp (progn (setf a (incf i)) #\b)
(progn (setf b (incf i)) #\a)))
i a b))
nil 2 1 2)
(deftest char-greaterp.order.3
(let ((i 0) a b c)
(values
(char-greaterp (progn (setq a (incf i)) #\b)
......@@ -476,3 +712,12 @@
(progn (setq c (incf i)) #\b))
i a b c))
nil 3 1 2 3)
(deftest char-greaterp.order.4
(let ((i 0) a b c)
(values
(char-greaterp (progn (setq a (incf i)) #\a)
(progn (setq b (incf i)) #\b)
(progn (setq c (incf i)) #\a))
i a b c))
nil 3 1 2 3)
......@@ -78,7 +78,7 @@
s)
"aaaXa")
(deftest char.11
(deftest char.order.1
(let ((i 0) a b)
(values
(char (progn (setf a (incf i)) "abc")
......@@ -86,7 +86,7 @@
i a b))
#\b 2 1 2)
(deftest char.12
(deftest char.order.2
(let ((i 0) a b c (s (make-string 5 :initial-element #\z)))
(values
(setf
......@@ -145,7 +145,7 @@
s)
"xxXxxx")
(deftest schar.11
(deftest schar.order.1
(let ((i 0) a b)
(values
(schar (progn (setf a (incf i)) "abc")
......@@ -153,7 +153,7 @@
i a b))
#\b 2 1 2)
(deftest schar.12
(deftest schar.order.2
(let ((i 0) a b c (s (copy-seq "zzzzz")))
(values
(setf
......
......@@ -63,14 +63,23 @@
(character.2.body)
nil)
(deftest character.3
(deftest character.order.1
(let ((i 0))
(values
(character (progn (incf i) #\a))
i))
#\a 1)
(deftest character.error.1
(classify-error (character))
program-error)
(deftest character.4
(deftest character.error.2
(classify-error (character #\a #\a))
program-error)
;;;
(deftest characterp.1
(every #'characterp +standard-chars+)
t)
......@@ -83,6 +92,13 @@
(characterp.3.body)
t)
(deftest characterp.order.1
(let ((i 0))
(values
(characterp (incf i))
i))
nil 1)
(deftest characterp.error.1
(classify-error (characterp))
program-error)
......@@ -99,6 +115,8 @@
(not (alpha-char-p c))))
t)
;;;
(deftest alpha-char-p.2
(every #'alpha-char-p +alpha-chars+)
t)
......@@ -107,6 +125,13 @@
(char-type-error-check #'alpha-char-p)
t)
(deftest alpha-char-p.order.1
(let ((i 0))
(values
(alpha-char-p (progn (incf i) #\8))
i))
nil 1)
(deftest alpha-char-p.error.1
(classify-error (alpha-char-p))
program-error)
......@@ -115,6 +140,8 @@
(classify-error (alpha-char-p #\a #\b))
program-error)
;;;
(deftest alphanumericp.1
(loop for c across +standard-chars+
always
......@@ -130,7 +157,6 @@
(char-type-error-check #'alphanumericp)
t)
(deftest alphanumericp.4
(alphanumericp.4.body)
t)
......@@ -139,6 +165,13 @@
(alphanumericp.5.body)
t)
(deftest alphanumericp.order.1
(let ((i 0))
(values
(alphanumericp (progn (incf i) #\?))
i))
nil 1)
(deftest alphanumericp.error.1
(classify-error (alphanumericp))
program-error)
......@@ -147,6 +180,8 @@
(classify-error (alphanumericp #\a #\b))
program-error)
;;;
(deftest digit-char.1
(digit-char.1.body)
t)
......@@ -158,6 +193,20 @@
nil nil nil nil nil nil nil nil nil nil
nil nil nil nil nil nil nil nil nil nil))
(deftest digit-char.order.1
(let ((i 0))
(values
(digit-char (incf i))
i))
#\1 1)
(deftest digit-char.order.2
(let ((i 0) x)
(values
(digit-char (incf i) (progn (setf x (incf i)) 10))
i x))
#\1 2 2)
(deftest digit-char.error.1
(classify-error (digit-char))
program-error)
......@@ -166,6 +215,8 @@
(classify-error (digit-char 0 10 'foo))
program-error)