Properly report errors about unbound ERT test symbols.
Assertions should only be used to check internal consistency within a package, not to check arguments passed by callers. Instead, define and use a new error symbol. * lisp/emacs-lisp/ert.el (ert-test-unbound): New error symbol. (ert-select-tests): Use it. * test/lisp/emacs-lisp/ert-tests.el (ert-test-select-undefined): New unit test. * etc/NEWS: Document new behavior.
This commit is contained in:
parent
94891dd225
commit
f6da1eed74
3 changed files with 16 additions and 2 deletions
|
@ -495,6 +495,12 @@ This macro is used to test if macroexpansion in `should' works."
|
|||
(should (equal (ert-select-tests '(tag b) (list test)) (list test)))
|
||||
(should (equal (ert-select-tests '(tag c) (list test)) '()))))
|
||||
|
||||
(ert-deftest ert-test-select-undefined ()
|
||||
(let* ((symbol (make-symbol "ert-not-a-test"))
|
||||
(data (should-error (ert-select-tests symbol t)
|
||||
:type 'ert-test-unbound)))
|
||||
(should (eq (cadr data) symbol))))
|
||||
|
||||
|
||||
;;; Tests for utility functions.
|
||||
(ert-deftest ert-test-parse-keys-and-body ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue