diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/floatfns-tests.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index 592efce359d..d41b08f7965 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el | |||
| @@ -20,10 +20,10 @@ | |||
| 20 | (require 'ert) | 20 | (require 'ert) |
| 21 | 21 | ||
| 22 | (ert-deftest divide-extreme-sign () | 22 | (ert-deftest divide-extreme-sign () |
| 23 | (should-error (ceiling most-negative-fixnum -1.0)) | 23 | (should (= (ceiling most-negative-fixnum -1.0) (- most-negative-fixnum))) |
| 24 | (should-error (floor most-negative-fixnum -1.0)) | 24 | (should (= (floor most-negative-fixnum -1.0) (- most-negative-fixnum))) |
| 25 | (should-error (round most-negative-fixnum -1.0)) | 25 | (should (= (round most-negative-fixnum -1.0) (- most-negative-fixnum))) |
| 26 | (should-error (truncate most-negative-fixnum -1.0))) | 26 | (should (= (truncate most-negative-fixnum -1.0) (- most-negative-fixnum)))) |
| 27 | 27 | ||
| 28 | (ert-deftest logb-extreme-fixnum () | 28 | (ert-deftest logb-extreme-fixnum () |
| 29 | (should (= (logb most-negative-fixnum) (1+ (logb most-positive-fixnum))))) | 29 | (should (= (logb most-negative-fixnum) (1+ (logb most-positive-fixnum))))) |
| @@ -66,6 +66,10 @@ | |||
| 66 | (1+ most-positive-fixnum) | 66 | (1+ most-positive-fixnum) |
| 67 | (* most-positive-fixnum most-positive-fixnum)))) | 67 | (* most-positive-fixnum most-positive-fixnum)))) |
| 68 | (dolist (n ns) | 68 | (dolist (n ns) |
| 69 | (should (= n (ceiling n))) | ||
| 70 | (should (= n (floor n))) | ||
| 71 | (should (= n (round n))) | ||
| 72 | (should (= n (truncate n))) | ||
| 69 | (dolist (d ns) | 73 | (dolist (d ns) |
| 70 | (let ((q (/ n d)) | 74 | (let ((q (/ n d)) |
| 71 | (r (% n d)) | 75 | (r (% n d)) |