aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2021-02-17 21:45:37 +0100
committerAndrea Corallo2021-02-17 22:03:41 +0100
commit1fe5994bcb8b58012dbba0a5f7d03138c293286f (patch)
tree255fa560db8547ea2d2174bbeb69ee4482f0885a /test/src
parent0d7c893203087d60f0ce549521f4c715c87a7038 (diff)
downloademacs-1fe5994bcb8b58012dbba0a5f7d03138c293286f.tar.gz
emacs-1fe5994bcb8b58012dbba0a5f7d03138c293286f.zip
Fix inverted logic in constraint comparison (bug#46540)
* lisp/emacs-lisp/comp-cstr.el (comp-cstr->, comp-cstr->=) (comp-cstr-<, comp-cstr-<=): Fix inverted logic. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add three integer constrain tests.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/comp-tests.el29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index c0325a8d5df..08c18894419 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -1211,7 +1211,34 @@ Return a list of results."
1211 (= x 3)) 1211 (= x 3))
1212 (error "Not foo or 3")) 1212 (error "Not foo or 3"))
1213 x) 1213 x)
1214 (or (member foo) (integer 3 3))))) 1214 (or (member foo) (integer 3 3)))
1215
1216 ;;58
1217 ((defun comp-tests-ret-type-spec-f (x y)
1218 (if (and (natnump x)
1219 (natnump y)
1220 (<= x y))
1221 x
1222 (error "")))
1223 (integer 0 *))
1224
1225 ;; 59
1226 ((defun comp-tests-ret-type-spec-f (x y)
1227 (if (and (>= x 3)
1228 (<= y 10)
1229 (<= x y))
1230 x
1231 (error "")))
1232 (or float (integer 3 10)))
1233
1234 ;; 60
1235 ((defun comp-tests-ret-type-spec-f (x y)
1236 (if (and (<= x 10)
1237 (>= y 3)
1238 (>= x y))
1239 x
1240 (error "")))
1241 (or float (integer 3 10)))))
1215 1242
1216 (defun comp-tests-define-type-spec-test (number x) 1243 (defun comp-tests-define-type-spec-test (number x)
1217 `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) () 1244 `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) ()