diff options
author | Philipp Stephani <phst@google.com> | 2017-03-26 20:53:43 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2017-04-08 17:15:31 +0200 |
commit | 98bfac68b98e051425c41873edc48f9af5c92361 (patch) | |
tree | 344d18686c78659e7cbe843080658d08cab0c4af /test/lisp | |
parent | 5ea696fd24c2bd8006050866fba0ccab1c0ff931 (diff) | |
download | emacs-98bfac68b98e051425c41873edc48f9af5c92361.tar.gz |
Validate SPEC of `dolist', cf. Bug#25477.
* lisp/subr.el (dolist): Test type and length of SPEC.
* test/lisp/subr-tests.el (subr-tests--dolist--wrong-number-of-args):
Add unit test.
Diffstat (limited to 'test/lisp')
-rw-r--r-- | test/lisp/subr-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index a3b08e96971..0d243cc5d8c 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -281,5 +281,15 @@ indirectly `mapbacktrace'." (should (equal (string-match-p "\\`[[:blank:]]\\'" "\u3000") 0)) (should-not (string-match-p "\\`[[:blank:]]\\'" "\N{LINE SEPARATOR}"))) +(ert-deftest subr-tests--dolist--wrong-number-of-args () + "Test that `dolist' doesn't accept wrong types or length of SPEC, +cf. Bug#25477." + (should-error (eval '(dolist (a))) + :type 'wrong-number-of-arguments) + (should-error (eval '(dolist (a () 'result 'invalid)) t) + :type 'wrong-number-of-arguments) + (should-error (eval '(dolist "foo") t) + :type 'wrong-type-argument)) + (provide 'subr-tests) ;;; subr-tests.el ends here |