emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/paredit 86f1f5f3dd 3/7: Stop each test on first failure or


From: ELPA Syncer
Subject: [nongnu] elpa/paredit 86f1f5f3dd 3/7: Stop each test on first failure or unexpected success.
Date: Sat, 9 Jul 2022 04:59:07 -0400 (EDT)

branch: elpa/paredit
commit 86f1f5f3dd3358e1bb557a02465017e48b9e23a1
Author: Taylor R Campbell <campbell+paredit@mumble.net>
Commit: Taylor R Campbell <campbell+paredit@mumble.net>

    Stop each test on first failure or unexpected success.
---
 test.el | 56 ++++++++++++++++++++++++++++++--------------------------
 1 file changed, 30 insertions(+), 26 deletions(-)

diff --git a/test.el b/test.el
index 539f8b2a22..07389a6595 100644
--- a/test.el
+++ b/test.el
@@ -43,33 +43,37 @@ Four arguments: the paredit command, the text of the buffer
             (and (eq (car example) 'xfail)
                  (progn (setq example (cdr example)) t)))
            (before (car example)))
-      (dolist (expected (cdr example))
-        (with-temp-buffer
-          (paredit-test-buffer-setup)
-          (insert before)
-          (goto-char (point-min))
-          (if (search-forward "_" nil t)
-              (progn (delete-char -1) (set-mark (point))))
-          (goto-char (point-min))
-          (search-forward "|")
-          (delete-char -1)
-          (if (cond ((eq expected 'error)
-                     ;++ Check that there are no more expected states.
-                     (condition-case condition
-                         (progn (call-interactively command) t)
-                       (error nil)))
-                    ((stringp expected)
-                     (call-interactively command)
-                     (insert ?\|)
-                     (not (string= expected (buffer-string))))
-                    (t (error "Bad test expectation: %S" expected)))
-              (if (not xfail)
+      (catch 'break
+        (dolist (expected (cdr example))
+          (with-temp-buffer
+            (paredit-test-buffer-setup)
+            (insert before)
+            (goto-char (point-min))
+            (if (search-forward "_" nil t)
+                (progn (delete-char -1) (set-mark (point))))
+            (goto-char (point-min))
+            (search-forward "|")
+            (delete-char -1)
+            (if (cond ((eq expected 'error)
+                       ;++ Check that there are no more expected states.
+                       (condition-case condition
+                           (progn (call-interactively command) t)
+                         (error nil)))
+                      ((stringp expected)
+                       (call-interactively command)
+                       (insert ?\|)
+                       (not (string= expected (buffer-string))))
+                      (t (error "Bad test expectation: %S" expected)))
+                (progn
+                  (if (not xfail)
+                      (let ((actual (buffer-string)))
+                        (paredit-test-failed command before actual expected)))
+                  (throw 'break nil))
+              (if xfail
                   (let ((actual (buffer-string)))
-                    (paredit-test-failed command before actual expected)))
-            (if xfail
-                (let ((actual (buffer-string)))
-                  (paredit-test-failed command before actual 'failure)))))
-        (setq before expected)))))
+                    (paredit-test-failed command before actual 'failure)
+                    (throw 'break nil)))))
+          (setq before expected))))))
 
 (defun paredit-test-buffer-setup ()
   (scheme-mode)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]