diff options
| author | Paul Eggert | 2017-03-07 21:23:08 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-03-07 21:23:47 -0800 |
| commit | 1590127335cef06af8d77884f9c16a8629d65943 (patch) | |
| tree | 32b8046ed3faf42a430eca93fcf56b7b1f853c25 /test/src | |
| parent | 1a6597660a405fe78885476f8761cab79167b4e1 (diff) | |
| download | emacs-1590127335cef06af8d77884f9c16a8629d65943.tar.gz emacs-1590127335cef06af8d77884f9c16a8629d65943.zip | |
min and max should not return markers
Problem reported by Glenn Morris in:
http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00147.html
* src/data.c (minmax_driver): Convert any marker result to an
integer, since some callers assume this.
* test/src/data-tests.el (data-tests-max, data-tests-min):
Test for this.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/data-tests.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el index 70ffdabe4d4..67d00a7f930 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el | |||
| @@ -88,7 +88,9 @@ | |||
| 88 | (should (= (1+ most-negative-fixnum) | 88 | (should (= (1+ most-negative-fixnum) |
| 89 | (max (float most-negative-fixnum) (1+ most-negative-fixnum)))) | 89 | (max (float most-negative-fixnum) (1+ most-negative-fixnum)))) |
| 90 | (should (= 8 (apply #'max '(3 8 3)))) | 90 | (should (= 8 (apply #'max '(3 8 3)))) |
| 91 | (should-error (max 9 8 'foo))) | 91 | (should-error (max 9 8 'foo)) |
| 92 | (should-error (max (make-marker))) | ||
| 93 | (should (eql 1 (max (point-min-marker) 1)))) | ||
| 92 | 94 | ||
| 93 | (ert-deftest data-tests-min () | 95 | (ert-deftest data-tests-min () |
| 94 | (should-error (min)) | 96 | (should-error (min)) |
| @@ -98,7 +100,9 @@ | |||
| 98 | (should (= most-positive-fixnum | 100 | (should (= most-positive-fixnum |
| 99 | (min (+ 1.0 most-positive-fixnum) most-positive-fixnum))) | 101 | (min (+ 1.0 most-positive-fixnum) most-positive-fixnum))) |
| 100 | (should (= 3 (apply #'min '(3 8 3)))) | 102 | (should (= 3 (apply #'min '(3 8 3)))) |
| 101 | (should-error (min 9 8 'foo))) | 103 | (should-error (min 9 8 'foo)) |
| 104 | (should-error (min (make-marker))) | ||
| 105 | (should (eql 1 (min (point-min-marker) 1)))) | ||
| 102 | 106 | ||
| 103 | ;; Bool vector tests. Compactly represent bool vectors as hex | 107 | ;; Bool vector tests. Compactly represent bool vectors as hex |
| 104 | ;; strings. | 108 | ;; strings. |