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

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

[elpa] externals/compat fc2ad0899d 6/7: Test buffer-local-boundp


From: ELPA Syncer
Subject: [elpa] externals/compat fc2ad0899d 6/7: Test buffer-local-boundp
Date: Wed, 4 Jan 2023 13:57:28 -0500 (EST)

branch: externals/compat
commit fc2ad0899d695596026278992ad25b8fa753ace1
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Test buffer-local-boundp
---
 compat-28.el    |  2 +-
 compat-tests.el | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/compat-28.el b/compat-28.el
index 2e0d8e6b75..4ab40da69b 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -384,7 +384,7 @@ REPLACEMENT can use the following special elements:
       (and (not (zerop matches))
            matches))))
 
-(compat-defun buffer-local-boundp (symbol buffer) ;; <UNTESTED>
+(compat-defun buffer-local-boundp (symbol buffer) ;; <OK>
   "Return non-nil if SYMBOL is bound in BUFFER.
 Also see `local-variable-p'."
   (catch 'fail
diff --git a/compat-tests.el b/compat-tests.el
index 41e25bc5fb..5334e3de62 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -89,6 +89,17 @@
 (ert-deftest format-message ()
   (should-equal (format-message "a=%s b=%s" 1 2) "a=1 b=2"))
 
+(defvar test-boundp)
+(defvar test-global-boundp)
+(ert-deftest buffer-local-boundp ()
+  (let ((buf (generate-new-buffer "boundp")))
+    (with-current-buffer buf
+      (setq-local test-boundp t))
+    (setq test-global-boundp t)
+    (should (buffer-local-boundp 'test-boundp buf))
+    (should-not (buffer-local-boundp 'test-not-boundp buf))
+    (should (buffer-local-boundp 'test-global-boundp buf))))
+
 (defvar compat-local-a nil)
 (defvar compat-local-b nil)
 (defvar compat-local-c nil)



reply via email to

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