branch: externals/compat
commit fc2ad0899d695596026278992ad25b8fa753ace1
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    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