Skip to content
Snippets Groups Projects
Commit bc1dd837 authored by pfdietz's avatar pfdietz
Browse files

Order of evaluation test for CONSTANTP. More subtypep tests, on various numeric types.

parent 2c81c320
No related branches found
No related tags found
No related merge requests found
...@@ -65,4 +65,13 @@ ...@@ -65,4 +65,13 @@
(notnot-mv (constantp 'pi)) (notnot-mv (constantp 'pi))
t) t)
(deftest constantp.order.1
(let ((i 0) x y)
(values
(notnot (constantp (progn (setf x (incf i)) 1)
(progn (setf y (incf i)) nil)))
i x y))
t 2 1 2)
...@@ -247,6 +247,42 @@ ...@@ -247,6 +247,42 @@
'(integer 0 15)) '(integer 0 15))
nil) nil)
(deftest subtypep.integer.28
(check-equivalence
'(and integer (not (eql 10)))
'(or (integer * 9) (integer 11 *)))
nil)
(deftest subtypep.integer.29
(check-equivalence
'(and integer (not (integer 1 10)))
'(or (integer * 0) (integer 11 *)))
nil)
(deftest subtypep.integer.30
(check-equivalence
'(and (integer -100 100) (not (integer 1 10)))
'(or (integer -100 0) (integer 11 100)))
nil)
(deftest subtypep.integer.31
(check-equivalence
'(and integer (real 4 10))
'(integer 4 10))
nil)
(deftest subtypep.integer.32
(check-equivalence
'(and (integer 4 *) (real * 10))
'(integer 4 10))
nil)
(deftest subtypep.integer.33
(check-equivalence
'(and (integer * 10) (real 4))
'(integer 4 10))
nil)
;;;;;;; ;;;;;;;
(deftest subtypep.float.1 (deftest subtypep.float.1
...@@ -417,6 +453,37 @@ ...@@ -417,6 +453,37 @@
nil) nil)
;;; SUBTYPEP on rational types
(deftest subtypep.rational.1
(subtypep* '(rational 10 *) 'rational)
t t)
(deftest subtypep.rational.2
(subtypep* '(rational 10) 'rational)
t t)
(deftest subtypep.rational.3
(subtypep* '(rational * 10) 'rational)
t t)
(deftest subtypep.rational.4
(subtypep '(rational 10 20) 'rational)
t t)
(deftest subtypep.rational.5
(subtypep '(rational (10) 20) 'rational)
t t)
(deftest subtypep.rational.6
(subtypep '(rational 10 (20)) 'rational)
t t)
(deftest subtypep.rational.7
(subtypep '(rational (10) (20)) 'rational)
t t)
;;; SUBTYPEP on CONS types ;;; SUBTYPEP on CONS types
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment