mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Better NaN handling in proced-tests.el
* test/lisp/proced-tests.el (proced--cpu-at-point): Make it more robust. (proced--assert-process-valid-cpu-refinement): Handle `ert-test-skipped' signal.
This commit is contained in:
parent
a7f34a532c
commit
fbc13ba9cc
1 changed files with 5 additions and 4 deletions
|
|
@ -38,10 +38,10 @@
|
||||||
(defun proced--cpu-at-point ()
|
(defun proced--cpu-at-point ()
|
||||||
"Return as an integer the current CPU value at point."
|
"Return as an integer the current CPU value at point."
|
||||||
(if (string-suffix-p "nan" (thing-at-point 'sexp))
|
(if (string-suffix-p "nan" (thing-at-point 'sexp))
|
||||||
(let ((pid (proced-pid-at-point)))
|
(ert-skip
|
||||||
(ert-skip
|
(format
|
||||||
(format
|
"Found NaN value for %%CPU at point for process with PID %s"
|
||||||
"Found NaN value for %%CPU at point for process with PID %d" pid)))
|
(substring-no-properties (thing-at-point 'sexp))))
|
||||||
(thing-at-point 'number)))
|
(thing-at-point 'number)))
|
||||||
|
|
||||||
(defun proced--assert-emacs-pid-in-buffer ()
|
(defun proced--assert-emacs-pid-in-buffer ()
|
||||||
|
|
@ -61,6 +61,7 @@
|
||||||
(proced--move-to-column "%CPU")
|
(proced--move-to-column "%CPU")
|
||||||
(condition-case err
|
(condition-case err
|
||||||
(>= (proced--cpu-at-point) cpu)
|
(>= (proced--cpu-at-point) cpu)
|
||||||
|
(ert-test-skipped (signal (car err) (cdr err)))
|
||||||
(error
|
(error
|
||||||
(ert-fail
|
(ert-fail
|
||||||
(list err (proced--assert-process-valid-cpu-refinement-explainer cpu))))))
|
(list err (proced--assert-process-valid-cpu-refinement-explainer cpu))))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue