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 ()
|
||||
"Return as an integer the current CPU value at point."
|
||||
(if (string-suffix-p "nan" (thing-at-point 'sexp))
|
||||
(let ((pid (proced-pid-at-point)))
|
||||
(ert-skip
|
||||
(format
|
||||
"Found NaN value for %%CPU at point for process with PID %d" pid)))
|
||||
(ert-skip
|
||||
(format
|
||||
"Found NaN value for %%CPU at point for process with PID %s"
|
||||
(substring-no-properties (thing-at-point 'sexp))))
|
||||
(thing-at-point 'number)))
|
||||
|
||||
(defun proced--assert-emacs-pid-in-buffer ()
|
||||
|
@ -61,6 +61,7 @@
|
|||
(proced--move-to-column "%CPU")
|
||||
(condition-case err
|
||||
(>= (proced--cpu-at-point) cpu)
|
||||
(ert-test-skipped (signal (car err) (cdr err)))
|
||||
(error
|
||||
(ert-fail
|
||||
(list err (proced--assert-process-valid-cpu-refinement-explainer cpu))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue