summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-03-07 21:23:08 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2017-03-07 21:23:47 -0800
commit1590127335cef06af8d77884f9c16a8629d65943 (patch)
tree32b8046ed3faf42a430eca93fcf56b7b1f853c25 /test
parent1a6597660a405fe78885476f8761cab79167b4e1 (diff)
downloademacs-1590127335cef06af8d77884f9c16a8629d65943.tar.gz
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')
-rw-r--r--test/src/data-tests.el8
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 @@
(should (= (1+ most-negative-fixnum)
(max (float most-negative-fixnum) (1+ most-negative-fixnum))))
(should (= 8 (apply #'max '(3 8 3))))
- (should-error (max 9 8 'foo)))
+ (should-error (max 9 8 'foo))
+ (should-error (max (make-marker)))
+ (should (eql 1 (max (point-min-marker) 1))))
(ert-deftest data-tests-min ()
(should-error (min))
@@ -98,7 +100,9 @@
(should (= most-positive-fixnum
(min (+ 1.0 most-positive-fixnum) most-positive-fixnum)))
(should (= 3 (apply #'min '(3 8 3))))
- (should-error (min 9 8 'foo)))
+ (should-error (min 9 8 'foo))
+ (should-error (min (make-marker)))
+ (should (eql 1 (min (point-min-marker) 1))))
;; Bool vector tests. Compactly represent bool vectors as hex
;; strings.