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

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

[elpa] externals/compat c626917 18/99: Add a named-let test


From: ELPA Syncer
Subject: [elpa] externals/compat c626917 18/99: Add a named-let test
Date: Sun, 17 Oct 2021 05:57:50 -0400 (EDT)

branch: externals/compat
commit c6269179e28708a1a89149b64f151c8e01266142
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Add a named-let test
---
 compat-tests.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/compat-tests.el b/compat-tests.el
index 4c2b311..ba54d41 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -42,7 +42,6 @@
 ;; - line-number-at-pos (`compat--line-number-at-pos')
 ;; - macroexp-file-name (`compat--macroexp-file-name')
 ;; - make-nearby-temp-file (`compat--make-nearby-temp-file')
-;; - named-let (`compat--named-let')
 ;; - package-get-version (`compat--package-get-version')
 ;; - recenter (`compat--recenter')
 ;; - replace-regexp-in-region (`compat--replace-regexp-in-region')
@@ -1197,5 +1196,12 @@ the compatibility function."
                (compat--should "Prompt 10: " "Prompt %d" nil 10)
                (compat--should "Prompt \"abc\" (default 3): " "Prompt %S" 3 
"abc")))
 
+(ert-deftest compat-named-let ()
+  "Check if `named-let' was implemented properly."
+  (should (= (compat--named-let l ((i 0)) (if (= i 8) i (l (1+ i))))
+             8))
+  (should (= (compat--named-let l ((i 0) (x 1)) (if (= i 8) x (l (1+ i) (* x 
2))))
+             (expt 2 8))))
+
 (provide 'compat-tests)
 ;;; compat-tests.el ends here



reply via email to

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