branch: externals/compat commit 5709f7c4a16b7137e7eb74d304ce7e1ba13114fa Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
compat-28: Add test for dlet --- compat-28.el | 2 +- compat-tests.el | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/compat-28.el b/compat-28.el index 43d2c9146c..339c06e07a 100644 --- a/compat-28.el +++ b/compat-28.el @@ -405,7 +405,7 @@ If `default-directory' is already an existing directory, it's not changed." "/"))) ,@body)) -(compat-defmacro dlet (binders &rest body) ;; <UNTESTED> +(compat-defmacro dlet (binders &rest body) ;; <OK> "Like `let' but using dynamic scoping." (declare (indent 1) (debug let)) `(let (_) diff --git a/compat-tests.el b/compat-tests.el index 5eea987985..64bb8de66f 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -1529,6 +1529,16 @@ (should-equal "defg" (string-replace "abc" "defg" "abc")) (should-error (string-replace "" "x" "abc") :type 'wrong-length-argument)) +(ert-deftest dlet () + (should-not (boundp 'compat-tests--dlet1)) + (should-not (boundp 'compat-tests--dlet2)) + (dlet ((compat-tests--dlet1 1) + (compat-tests--dlet2 2)) + (should-equal (symbol-value 'compat-tests--dlet1) 1) + (should-equal (symbol-value 'compat-tests--dlet2) 2)) + (should-not (boundp 'compat-tests--dlet1)) + (should-not (boundp 'compat-tests--dlet2))) + (ert-deftest when-let* () (should-equal "second" (when-let*