branch: externals/compat
commit b97b7568717b023e80c5e79b48b13fe642e81193
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Restore if-let test
---
compat-tests.el | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/compat-tests.el b/compat-tests.el
index 96ec1de212..ded6e568ff 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1171,6 +1171,20 @@
(remhash 1 ht)
(should-equal '(two) (hash-table-values ht))))
+(ert-deftest if-let ()
+ (should (if-let (e (memq 0 '(1 2 3 0 5 6)))
+ e))
+ (should (if-let ((e (memq 0 '(1 2 3 0 5 6))))
+ e))
+ (should-not (if-let ((e (memq 0 '(1 2 3 5 6)))
+ (d (memq 0 '(1 2 3 0 5 6))))
+ t))
+ (should-not (if-let ((d (memq 0 '(1 2 3 0 5 6)))
+ (e (memq 0 '(1 2 3 5 6))))
+ t))
+ (should-not
+ (if-let (((= 5 6))) t nil)))
+
(ert-deftest and-let* ()
(should ;trivial body
(and-let*
@@ -1620,18 +1634,6 @@
;; (should-not
;; (if-let* (((= 5 6))) t nil)))
-;; (ert-deftest if-let ()
-;; (should (if-let ((e (memq 0 '(1 2 3 0 5 6))))
-;; e))
-;; (should-not (if-let ((e (memq 0 '(1 2 3 5 6)))
-;; (d (memq 0 '(1 2 3 0 5 6))))
-;; t))
-;; (should-not (if-let ((d (memq 0 '(1 2 3 0 5 6)))
-;; (e (memq 0 '(1 2 3 5 6))))
-;; t))
-;; (should-not
-;; (if-let (((= 5 6))) t nil)))
-
;; (ert-deftest regexp-unmatchable ()
;; (dolist (str '("" ;empty string
;; "a" ;simple string