diff options
| author | Glenn Morris | 2017-04-13 21:17:09 -0400 |
|---|---|---|
| committer | Glenn Morris | 2017-04-13 21:17:09 -0400 |
| commit | 86e512ed10d83e2d233cfb95bff68b6c05729686 (patch) | |
| tree | c2876fe13791afb5e268807907944497f9b26d51 | |
| parent | a855473b7079b467ac01dbcee89cb57b3599fdac (diff) | |
| download | emacs-86e512ed10d83e2d233cfb95bff68b6c05729686.tar.gz emacs-86e512ed10d83e2d233cfb95bff68b6c05729686.zip | |
Use user-error for some ert.el errors
* lisp/emacs-lisp/ert.el (ert-read-test-name, ert-delete-all-tests)
(ert-results-find-test-at-point-other-window, ert-describe-test):
Use user-error.
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index e7387e463cb..7eaf33a27dc 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -1602,7 +1602,7 @@ Signals an error if no test name was read." | |||
| 1602 | (let ((sym (intern-soft input))) | 1602 | (let ((sym (intern-soft input))) |
| 1603 | (if (ert-test-boundp sym) | 1603 | (if (ert-test-boundp sym) |
| 1604 | sym | 1604 | sym |
| 1605 | (error "Input does not name a test"))))) | 1605 | (user-error "Input does not name a test"))))) |
| 1606 | 1606 | ||
| 1607 | (defun ert-read-test-name-at-point (prompt) | 1607 | (defun ert-read-test-name-at-point (prompt) |
| 1608 | "Read the name of a test and return it as a symbol. | 1608 | "Read the name of a test and return it as a symbol. |
| @@ -1628,7 +1628,7 @@ Nothing more than an interactive interface to `ert-make-test-unbound'." | |||
| 1628 | (interactive) | 1628 | (interactive) |
| 1629 | (when (called-interactively-p 'any) | 1629 | (when (called-interactively-p 'any) |
| 1630 | (unless (y-or-n-p "Delete all tests? ") | 1630 | (unless (y-or-n-p "Delete all tests? ") |
| 1631 | (error "Aborted"))) | 1631 | (user-error "Aborted"))) |
| 1632 | ;; We can't use `ert-select-tests' here since that gives us only | 1632 | ;; We can't use `ert-select-tests' here since that gives us only |
| 1633 | ;; test objects, and going from them back to the test name symbols | 1633 | ;; test objects, and going from them back to the test name symbols |
| 1634 | ;; can fail if the `ert-test' defstruct has been redefined. | 1634 | ;; can fail if the `ert-test' defstruct has been redefined. |
| @@ -2141,7 +2141,7 @@ To be used in the ERT results buffer." | |||
| 2141 | 2141 | ||
| 2142 | To be used in the ERT results buffer." | 2142 | To be used in the ERT results buffer." |
| 2143 | (or (ert--results-test-node-or-null-at-point) | 2143 | (or (ert--results-test-node-or-null-at-point) |
| 2144 | (error "No test at point"))) | 2144 | (user-error "No test at point"))) |
| 2145 | 2145 | ||
| 2146 | (defun ert-results-next-test () | 2146 | (defun ert-results-next-test () |
| 2147 | "Move point to the next test. | 2147 | "Move point to the next test. |
| @@ -2191,7 +2191,7 @@ To be used in the ERT results buffer." | |||
| 2191 | (interactive) | 2191 | (interactive) |
| 2192 | (let ((name (ert-test-at-point))) | 2192 | (let ((name (ert-test-at-point))) |
| 2193 | (unless name | 2193 | (unless name |
| 2194 | (error "No test at point")) | 2194 | (user-error "No test at point")) |
| 2195 | (ert-find-test-other-window name))) | 2195 | (ert-find-test-other-window name))) |
| 2196 | 2196 | ||
| 2197 | (defun ert--test-name-button-action (button) | 2197 | (defun ert--test-name-button-action (button) |
| @@ -2352,7 +2352,7 @@ To be used in the ERT results buffer." | |||
| 2352 | (cl-destructuring-bind (test redefinition-state) | 2352 | (cl-destructuring-bind (test redefinition-state) |
| 2353 | (ert--results-test-at-point-allow-redefinition) | 2353 | (ert--results-test-at-point-allow-redefinition) |
| 2354 | (when (null test) | 2354 | (when (null test) |
| 2355 | (error "No test at point")) | 2355 | (user-error "No test at point")) |
| 2356 | (let* ((stats ert--results-stats) | 2356 | (let* ((stats ert--results-stats) |
| 2357 | (progress-message (format "Running %stest %S" | 2357 | (progress-message (format "Running %stest %S" |
| 2358 | (cl-ecase redefinition-state | 2358 | (cl-ecase redefinition-state |
| @@ -2525,7 +2525,7 @@ To be used in the ERT results buffer." | |||
| 2525 | "Display the documentation for TEST-OR-TEST-NAME (a symbol or ert-test)." | 2525 | "Display the documentation for TEST-OR-TEST-NAME (a symbol or ert-test)." |
| 2526 | (interactive (list (ert-read-test-name-at-point "Describe test"))) | 2526 | (interactive (list (ert-read-test-name-at-point "Describe test"))) |
| 2527 | (when (< emacs-major-version 24) | 2527 | (when (< emacs-major-version 24) |
| 2528 | (error "Requires Emacs 24")) | 2528 | (user-error "Requires Emacs 24 or later")) |
| 2529 | (let (test-name | 2529 | (let (test-name |
| 2530 | test-definition) | 2530 | test-definition) |
| 2531 | (cl-etypecase test-or-test-name | 2531 | (cl-etypecase test-or-test-name |