aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPhilipp Stephani2019-01-17 23:39:19 +0100
committerPhilipp Stephani2019-01-20 00:04:19 +0100
commit551051596fe51d6e232315eeda8a0a79eb43bfdf (patch)
treedd2b179cb2dbe29fbea8d26fdd73ca8a29dae154 /test/src
parent3e1255172334f3c0645d37eb92c05a628fa3d548 (diff)
downloademacs-551051596fe51d6e232315eeda8a0a79eb43bfdf.tar.gz
emacs-551051596fe51d6e232315eeda8a0a79eb43bfdf.zip
Improve error data when passing a wrong type to 'sort' (Bug#34104)
* src/fns.c (Fsort): Use 'list-or-vector-p' for error message. (syms_of_fns): Define 'list-or-vector-p'. * test/src/fns-tests.el (fns-tests-sort): Extend unit test.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fns-tests.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 3d1a8b37b4e..d6cc99e8e33 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -161,7 +161,10 @@
161 '(9 . "ppp") '(8 . "ttt") '(8 . "eee") '(9 . "fff")) 161 '(9 . "ppp") '(8 . "ttt") '(8 . "eee") '(9 . "fff"))
162 (lambda (x y) (< (car x) (car y)))) 162 (lambda (x y) (< (car x) (car y))))
163 [(8 . "xxx") (8 . "bbb") (8 . "ttt") (8 . "eee") 163 [(8 . "xxx") (8 . "bbb") (8 . "ttt") (8 . "eee")
164 (9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")]))) 164 (9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")]))
165 ;; Bug#34104
166 (should (equal (should-error (sort "cba" #'<) :type 'wrong-type-argument)
167 '(wrong-type-argument list-or-vector-p "cba"))))
165 168
166(ert-deftest fns-tests-collate-sort () 169(ert-deftest fns-tests-collate-sort ()
167 (skip-unless (fns-tests--collate-enabled-p)) 170 (skip-unless (fns-tests--collate-enabled-p))