diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/data-tests.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el index d38760cdde6..70ffdabe4d4 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el | |||
| @@ -80,6 +80,26 @@ | |||
| 80 | ;; Short circuits before getting to bad arg | 80 | ;; Short circuits before getting to bad arg |
| 81 | (should-not (>= 8 9 'foo))) | 81 | (should-not (>= 8 9 'foo))) |
| 82 | 82 | ||
| 83 | (ert-deftest data-tests-max () | ||
| 84 | (should-error (max)) | ||
| 85 | (should (= 1 (max 1))) | ||
| 86 | (should (= 3 (max 3 2))) | ||
| 87 | (should (= 666 (max 666 1 0 0 -2 -3 -3 -3 -4 -8 -8 -9 -999))) | ||
| 88 | (should (= (1+ most-negative-fixnum) | ||
| 89 | (max (float most-negative-fixnum) (1+ most-negative-fixnum)))) | ||
| 90 | (should (= 8 (apply #'max '(3 8 3)))) | ||
| 91 | (should-error (max 9 8 'foo))) | ||
| 92 | |||
| 93 | (ert-deftest data-tests-min () | ||
| 94 | (should-error (min)) | ||
| 95 | (should (= 1 (min 1))) | ||
| 96 | (should (= 2 (min 3 2))) | ||
| 97 | (should (= -999 (min 666 1 0 0 -2 -3 -3 -3 -4 -8 -8 -9 -999))) | ||
| 98 | (should (= most-positive-fixnum | ||
| 99 | (min (+ 1.0 most-positive-fixnum) most-positive-fixnum))) | ||
| 100 | (should (= 3 (apply #'min '(3 8 3)))) | ||
| 101 | (should-error (min 9 8 'foo))) | ||
| 102 | |||
| 83 | ;; Bool vector tests. Compactly represent bool vectors as hex | 103 | ;; Bool vector tests. Compactly represent bool vectors as hex |
| 84 | ;; strings. | 104 | ;; strings. |
| 85 | 105 | ||