summaryrefslogtreecommitdiff
path: root/test/src/data-tests.el
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-08-04 10:50:35 -0600
committerTom Tromey <tom@tromey.com>2018-08-04 10:50:35 -0600
commit91d505d8e2cd8a5736f4ed76bb5aabfbc4410e89 (patch)
tree7783e8f6bf76dda146880afdacb2f2db09f4b0eb /test/src/data-tests.el
parentbc8ff54efee05f4a2769be32046866ed1e152b41 (diff)
downloademacs-91d505d8e2cd8a5736f4ed76bb5aabfbc4410e89.tar.gz
Fix bignum comparisons with NaN
* src/data.c (isnan): Move earlier. (bignumcompare): Explicitly handle NaN. * test/src/data-tests.el (data-tests-min): Add NaN tests for bignum. (data-check-sign): Fix for previous patch. * test/src/fns-tests.el (test-bignum-eql): Add NaN test.
Diffstat (limited to 'test/src/data-tests.el')
-rw-r--r--test/src/data-tests.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 07159df48cf..ee6a3eb9222 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -105,7 +105,9 @@
(should (isnan (min 0.0e+NaN)))
(should (isnan (min 0.0e+NaN 1 2)))
(should (isnan (min 1.0 0.0e+NaN)))
- (should (isnan (min 1.0 0.0e+NaN 1.1))))
+ (should (isnan (min 1.0 0.0e+NaN 1.1)))
+ (should (isnan (min 1.0 0.0e+NaN 1.1 (1+ most-positive-fixnum))))
+ (should (isnan (max 1.0 0.0e+NaN 1.1 (1+ most-positive-fixnum)))))
(defun data-tests-popcnt (byte)
"Calculate the Hamming weight of BYTE."
@@ -618,6 +620,6 @@ comparing the subr with a much slower lisp implementation."
(should (= (ash most-negative-fixnum 1)
(* most-negative-fixnum 2)))
(should (= (lsh most-negative-fixnum 1)
- (* (abs most-negative-fixnum) 2))))
+ (* most-negative-fixnum 2))))
;;; data-tests.el ends here