diff options
author | Andrea Corallo <akrl@sdf.org> | 2021-03-06 20:38:00 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2021-03-06 20:38:00 +0100 |
commit | 05259c4a238efa40fa66ac51844aa5227b9c576b (patch) | |
tree | e2fd7621897a67d2fcaf34c55dc65ba457fcf2bd /test/src | |
parent | 552ef6d6c0733b864bcb14eeb6183d7e64df3b80 (diff) | |
download | emacs-05259c4a238efa40fa66ac51844aa5227b9c576b.tar.gz emacs-05259c4a238efa40fa66ac51844aa5227b9c576b.tar.bz2 emacs-05259c4a238efa40fa66ac51844aa5227b9c576b.zip |
Fix `=' propagation to handle -0.0 0.0 case
* lisp/emacs-lisp/comp-cstr.el
(comp-cstr-intersection-homogeneous): Fix indent + use `memql'.
(comp-cstr-=): Handle 0.0 -0.0 idiosyncrasy
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two
tests and fix enumeration.
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/comp-tests.el | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index dae2abca7e7..cd1c2e0735e 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -1299,32 +1299,48 @@ Return a list of results." (error ""))) cons) - ;; 69 + ;; 68 ((defun comp-tests-ret-type-spec-f (x) (if (and (floatp x) - (= x 0)) + (= x 1)) x (error ""))) ;; Conservative (see cstr relax in `comp-cstr-='). - (or (member 0.0) (integer 0 0))) + (or (member 1.0) (integer 1 1))) - ;; 70 + ;; 69 ((defun comp-tests-ret-type-spec-f (x) (if (and (integer x) - (= x 0)) + (= x 1)) x (error ""))) ;; Conservative (see cstr relax in `comp-cstr-='). - (or (member 0.0) (integer 0 0))) + (or (member 1.0) (integer 1 1))) - ;; 71 + ;; 70 ((defun comp-tests-ret-type-spec-f (x y) (if (and (floatp x) (integerp y) (= x y)) x (error ""))) - (or float integer)))) + (or float integer)) + + ;; 71 + ((defun comp-tests-ret-type-spec-f (x) + (if (= x 0.0) + x + (error ""))) + (or (member -0.0 0.0) (integer 0 0))) + + ;; 72 + ((defun comp-tests-ret-type-spec-f (x) + (unless (= x 0.0) + (error "")) + (unless (eql x -0.0) + (error "")) + x) + float))) (defun comp-tests-define-type-spec-test (number x) `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) () |