branch: externals/compat
commit f3799fd74596c0acefb6d26475f2519c99dbe885
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Test setq-local
---
compat-27.el | 6 +++---
compat-28.el | 12 ++++++------
compat-tests.el | 9 +++++++++
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/compat-27.el b/compat-27.el
index c2bd7e20af..defa8d4493 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -365,7 +365,7 @@ where USER is a valid login name."
;;;; Defined in subr.el
-(compat-defmacro setq-local (&rest pairs) ;; <UNTESTED>
+(compat-defmacro setq-local (&rest pairs) ;; <OK>
"Handle multiple assignments."
:explicit t
(unless (zerop (mod (length pairs) 2))
@@ -771,7 +771,7 @@ The return value is a string (or nil in case we can’t find
it)."
:feature text-property-search
(aref match 3))
-(compat-defun text-property-search-forward ;; <UNTESTED>
+(compat-defun text-property-search-forward ;; <OK>
(property &optional value predicate not-current)
"Search for the next region of text where PREDICATE is true.
PREDICATE is used to decide whether a value of PROPERTY should be
@@ -876,7 +876,7 @@ the buffer positions that limit the region, and
(and (not (eq ended t))
ended))))))
-(compat-defun text-property-search-backward ;; <UNTESTED>
+(compat-defun text-property-search-backward ;; <OK>
(property &optional value predicate not-current)
"Search for the previous region of text whose PROPERTY matches VALUE.
diff --git a/compat-28.el b/compat-28.el
index a333143b5f..5df1b56327 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -419,7 +419,7 @@ If `default-directory' is already an existing directory,
it's not changed."
binders)
(let ,binders ,@body)))
-(compat-defun ensure-list (object) ;; <UNTESTED>
+(compat-defun ensure-list (object) ;; <OK>
"Return OBJECT as a list.
If OBJECT is already a list, return OBJECT itself. If it's
not a list, return a one-element list containing OBJECT."
@@ -427,7 +427,7 @@ not a list, return a one-element list containing OBJECT."
object
(list object)))
-(compat-defun subr-primitive-p (object) ;; <UNTESTED>
+(compat-defun subr-primitive-p (object) ;; <OK>
"Return t if OBJECT is a built-in primitive function."
(subrp object))
@@ -580,7 +580,7 @@ as the new values of the bound variables in the recursive
invocation."
;;;; Defined in files.el
-(compat-defun file-name-with-extension (filename extension) ;; <UNTESTED>
+(compat-defun file-name-with-extension (filename extension) ;; <OK>
"Set the EXTENSION of a FILENAME.
The extension (in a file name) is the part that begins with the last \".\".
@@ -614,7 +614,7 @@ See `file-symlink-p' to distinguish symlinks."
(and (file-directory-p dir)
(null (directory-files dir nil directory-files-no-dot-files-regexp t))))
-(compat-defun file-modes-number-to-symbolic (mode &optional filetype) ;;
<UNTESTED>
+(compat-defun file-modes-number-to-symbolic (mode &optional filetype) ;; <OK>
"Return a string describing a file's MODE.
For instance, if MODE is #o700, then it produces `-rwx------'.
FILETYPE if provided should be a character denoting the type of file,
@@ -671,7 +671,7 @@ recent files are first."
(push candidate files))))
(sort files #'file-newer-than-file-p)))
-(compat-defun make-lock-file-name (filename) ;; <UNTESTED>
+(compat-defun make-lock-file-name (filename) ;; <OK>
"Make a lock file name for FILENAME.
This prepends \".#\" to the non-directory part of FILENAME, and
doesn't respect `lock-file-name-transforms', as Emacs 28.1 and
@@ -694,7 +694,7 @@ onwards does."
;;;; Defined in minibuffer.el
-(compat-defun format-prompt (prompt default &rest format-args) ;; <UNTESTED>
+(compat-defun format-prompt (prompt default &rest format-args) ;; <OK>
"Format PROMPT with DEFAULT.
If FORMAT-ARGS is nil, PROMPT is used as a plain string. If
FORMAT-ARGS is non-nil, PROMPT is used as a format control
diff --git a/compat-tests.el b/compat-tests.el
index c0bf618154..68010629cb 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -46,6 +46,15 @@
(defmacro should-equal (a b)
`(should (equal ,a ,b)))
+(defvar compat-local-a nil)
+(defvar compat-local-b nil)
+(defvar compat-local-c nil)
+(ert-deftest setq-local ()
+ (compat-call setq-local compat-local-a 1 compat-local-b 2 compat-local-c 3)
+ (should-equal compat-local-a 1)
+ (should-equal compat-local-b 2)
+ (should-equal compat-local-c 3))
+
(ert-deftest gensym ()
(should (symbolp (gensym "compat")))
(should (string-prefix-p "compat" (symbol-name (gensym 'compat))))