[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 35072b3d25 22/27: Fix if-let and add tests
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 35072b3d25 22/27: Fix if-let and add tests |
Date: |
Sat, 5 Mar 2022 04:57:28 -0500 (EST) |
branch: externals/compat
commit 35072b3d252bbabf07d132bfdabe3933d987a3ce
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Fix if-let and add tests
---
compat-25.el | 2 +-
compat-tests.el | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/compat-25.el b/compat-25.el
index da084b807e..0e107cb6c5 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -169,7 +169,7 @@ with an old syntax that accepted only one binding."
(not (listp (car spec))))
;; Adjust the single binding case
(setq spec (list spec)))
- `(compat--if-let* ,spec ,then ,@(macroexp-unprogn else)))
+ `(compat--if-let* ,spec ,then ,(macroexp-progn else)))
(compat-defmacro when-let (spec &rest body)
"Bind variables according to SPEC and conditionally evaluate BODY.
diff --git a/compat-tests.el b/compat-tests.el
index 6d781d25ca..bb959dc711 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1275,6 +1275,19 @@ the compatibility function."
(should-not
(compat--if-let* (((= 5 6))) t nil)))
+(ert-deftest compat-if-let ()
+ "Check if `compat--if-let' was implemented properly."
+ (should (compat--if-let ((e (memq 0 '(1 2 3 0 5 6))))
+ e))
+ (should-not (compat--if-let ((e (memq 0 '(1 2 3 5 6)))
+ (d (memq 0 '(1 2 3 0 5 6))))
+ t))
+ (should-not (compat--if-let ((d (memq 0 '(1 2 3 0 5 6)))
+ (e (memq 0 '(1 2 3 5 6))))
+ t))
+ (should-not
+ (compat--if-let (((= 5 6))) t nil)))
+
(ert-deftest compat-and-let* ()
"Check if `compat--if-let*' was implemented properly."
(should ;trivial body
- [elpa] externals/compat 0706a69997 04/27: Avoid using gensym in with-existing-directory, (continued)
- [elpa] externals/compat 0706a69997 04/27: Avoid using gensym in with-existing-directory, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 28a6e2db53 06/27: Remove unnecessary whitespace before closing parentheses, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 26ee17853e 07/27: Add bool-vector functions, ELPA Syncer, 2022/03/05
- [elpa] externals/compat efb9ff712a 10/27: Add completion-table-merge and completion-table-with-cache, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 4aca90834f 09/27: Add get-pos-property to missing functions in 24.4, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 3f511afce0 12/27: Add directory-files-recursively, ELPA Syncer, 2022/03/05
- [elpa] externals/compat efa6e171e5 13/27: Document define-advice as not implemented, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 441539ae8b 11/27: Add face-spec-set, ELPA Syncer, 2022/03/05
- [elpa] externals/compat b3b75333b1 14/27: Document generators as not implemented, ELPA Syncer, 2022/03/05
- [elpa] externals/compat c4893fa014 15/27: Document bufferpos-to-filepos as not implemented, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 35072b3d25 22/27: Fix if-let and add tests,
ELPA Syncer <=
- [elpa] externals/compat ece91a5b89 03/27: Add function-put, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 9034bcc0ac 05/27: Fix broken markup in some deftest docstrings, ELPA Syncer, 2022/03/05
- [elpa] externals/compat c8bc47b671 18/27: Add replace-string-in-region, ELPA Syncer, 2022/03/05
- [elpa] externals/compat a92aec7251 19/27: Add file-modes-number-to-symbolic, ELPA Syncer, 2022/03/05
- [elpa] externals/compat ba2918d6d3 21/27: Add file-backup-file-names, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 15ca463a9e 20/27: Document that null-device and path-separator are not implemented, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 6b14d5fa3b 24/27: Exclude the generated manual from the repository, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 63ac5dd347 16/27: Add assoc-delete-all, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 8eb72a2739 25/27: Convert JSON advice for Emacs 28 to prefixed functions, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 9fa3fbab8a 27/27: Fix (provide) in compat-tests.el, ELPA Syncer, 2022/03/05