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

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

[nongnu] elpa/buttercup 8afc407 286/340: Switch from to pcase for spec-d


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup 8afc407 286/340: Switch from to pcase for spec-done in buttercup-reporter-batch-color
Date: Thu, 16 Dec 2021 14:59:52 -0500 (EST)

branch: elpa/buttercup
commit 8afc407d513f6b4adcf5e0212f555b89d71e4448
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>

    Switch from to pcase for spec-done in buttercup-reporter-batch-color
    
    Completely equivalent to the cond for used.
---
 buttercup.el | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index d010614..eeaf5d3 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1653,25 +1653,25 @@ EVENT and ARG are described in `buttercup-reporter'."
      (unless (string-match-p "[\n\v\f]" (buttercup-spec-description arg))
        (buttercup-reporter-batch event arg)))
     (`spec-done
-       (cond
-        ((eq (buttercup-spec-status arg) 'passed)
-         (buttercup--print (buttercup-colorize "\r%s" 'green)
-                           (buttercup--indented-description arg)))
-        ((eq (buttercup-spec-status arg) 'failed)
-         (buttercup--print (buttercup-colorize "\r%s  FAILED" 'red)
-                           (buttercup--indented-description arg))
-         (setq buttercup-reporter-batch--failures
-               (append buttercup-reporter-batch--failures
-                       (list arg))))
-        ((eq (buttercup-spec-status arg) 'pending)
-         (if (equal (buttercup-spec-failure-description arg) "SKIPPED")
-             (buttercup--print "  %s" (buttercup-spec-failure-description arg))
-           (buttercup--print (buttercup-colorize "\r%s  %s" 'yellow)
-                             (buttercup--indented-description arg)
-                             (buttercup-spec-failure-description arg))))
-        (t
-         (error "Unknown spec status %s" (buttercup-spec-status arg))))
-       (buttercup--print " (%s)\n" (buttercup-elapsed-time-string arg)))
+     (pcase (buttercup-spec-status arg)
+       (`passed
+        (buttercup--print (buttercup-colorize "\r%s" 'green)
+                          (buttercup--indented-description arg)))
+       (`failed
+        (buttercup--print (buttercup-colorize "\r%s  FAILED" 'red)
+                          (buttercup--indented-description arg))
+        (setq buttercup-reporter-batch--failures
+              (append buttercup-reporter-batch--failures
+                      (list arg))))
+       (`pending
+        (if (equal (buttercup-spec-failure-description arg) "SKIPPED")
+            (buttercup--print "  %s" (buttercup-spec-failure-description arg))
+          (buttercup--print (buttercup-colorize "\r%s  %s" 'yellow)
+                            (buttercup--indented-description arg)
+                            (buttercup-spec-failure-description arg))))
+       (_
+        (error "Unknown spec status %s" (buttercup-spec-status arg))))
+     (buttercup--print " (%s)\n" (buttercup-elapsed-time-string arg)))
 
     (`buttercup-done
      (dolist (failed buttercup-reporter-batch--failures)



reply via email to

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