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

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

[nongnu] elpa/buttercup 075b318 198/340: Add support for :var*


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup 075b318 198/340: Add support for :var*
Date: Thu, 16 Dec 2021 14:59:33 -0500 (EST)

branch: elpa/buttercup
commit 075b318a3aab191e42b976c36aa08a9dfaf9a4d5
Author: Kevin J. Foley <kfoley15@gmail.com>
Commit: Kevin J. Foley <kfoley15@gmail.com>

    Add support for :var*
    
    Wraps suite in let* form
---
 buttercup.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 49f5669..dbeb966 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -805,10 +805,15 @@ form.")
 DESCRIPTION is a string. BODY is a sequence of instructions,
 mainly calls to `describe', `it' and `before-each'."
   (declare (indent 1) (debug (&define sexp def-body)))
-  (let ((new-body (if (eq (elt body 0) :var)
-                      `((let ,(elt body 1)
-                          ,@(cddr body)))
-                    body)))
+  (let ((new-body
+         (cond
+          ((eq (elt body 0) :var)
+           `((let ,(elt body 1)
+               ,@(cddr body))))
+          ((eq (elt body 0) :var*)
+           `((let* ,(elt body 1)
+               ,@(cddr body))))
+          (t body))))
     `(buttercup-describe ,description (lambda () ,@new-body))))
 
 (defun buttercup-describe (description body-function)



reply via email to

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