diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 272fd4aec2..c659e4f3fc 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1496,16 +1496,16 @@ ert-summarize-tests-batch-and-exit (setq ntests (+ ntests (string-to-number (match-string 1)))) (if (not (re-search-forward "^\\(Aborted: \\)?\ Ran \\([0-9]+\\) tests, \\([0-9]+\\) results as expected\ -\\(?:, \\([0-9]+\\) unexpected\\)?\ +, \\([0-9]+\\) unexpected\ \\(?:, \\([0-9]+\\) skipped\\)?" nil t)) (push logfile badtests) (if (match-string 1) (push logfile badtests)) (setq nrun (+ nrun (string-to-number (match-string 2))) nexpected (+ nexpected (string-to-number (match-string 3)))) - (when (match-string 4) - (push logfile unexpected) - (setq nunexpected (+ nunexpected - (string-to-number (match-string 4))))) + (let ((n (string-to-number (match-string 4)))) + (setq nunexpected (+ nunexpected n)) + (unless (zerop n) + (push logfile unexpected))) (when (match-string 5) (push logfile skipped) (setq nskipped (+ nskipped