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

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

[elpa] externals/compat e37ef6fd63 07/11: Fix tests


From: ELPA Syncer
Subject: [elpa] externals/compat e37ef6fd63 07/11: Fix tests
Date: Wed, 4 Jan 2023 08:57:27 -0500 (EST)

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

    Fix tests
---
 compat-tests.el | 34 ++++++++++++++--------------
 compat.texi     | 70 ++++++++++++++++++++++++++++-----------------------------
 2 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index f921b6a55e..bfe409b1a2 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -174,29 +174,29 @@
   (should (equal ":/bar/foo" (file-local-name "/ssh:::/bar/foo"))))
 
 (ert-deftest file-name-quoted-p ()
-  (should (equal nil (file-name-quoted-p "")))
-  (should (equal t (file-name-quoted-p "/:")))
-  (should (equal nil (file-name-quoted-p "//:")))
-  (should (equal t (file-name-quoted-p "/::")))
-  (should (equal nil (file-name-quoted-p "/ssh::")))
-  (should (equal nil (file-name-quoted-p "/ssh::a")))
-  (should (equal t (file-name-quoted-p "/ssh::/:a")))
+  (should (equal nil (compat-call file-name-quoted-p "")))
+  (should (equal t (compat-call file-name-quoted-p "/:")))
+  (should (equal nil (compat-call file-name-quoted-p "//:")))
+  (should (equal t (compat-call file-name-quoted-p "/::")))
+  (should (equal nil (compat-call file-name-quoted-p "/ssh::")))
+  (should (equal nil (compat-call file-name-quoted-p "/ssh::a")))
+  (should (equal t (compat-call file-name-quoted-p "/ssh::/:a")))
   ;; These tests fails prior to Emacs 26, because /ssh:foo was a valid
   ;; TRAMP path back then.
   ;;
-  ;; (should (equal nil "/ssh:/:a")
+  ;; (should (equal nil (compat-call file-name-quoted-p "/ssh:/:a")))
   )
 
 (ert-deftest file-name-quote ()
-  (should (equal "/:" (file-name-quote "")))
-  (should (equal "/::"(file-name-quote  ":")))
-  (should (equal "/:/" (file-name-quote "/")))
-  (should (equal "/:" (file-name-quote "/:")))
-  (should (equal "/:a" (file-name-quote "a")))
-  (should (equal "/::a" (file-name-quote ":a")))
-  (should (equal "/:/a" (file-name-quote "/a")))
-  (should (equal "/:a" (file-name-quote "/:a")))
-  (should (equal (concat "/ssh:" (system-name) ":/:a") (file-name-quote 
"/ssh::a"))))
+  (should (equal "/:" (compat-call file-name-quote "")))
+  (should (equal "/::"(compat-call file-name-quote  ":")))
+  (should (equal "/:/" (compat-call file-name-quote "/")))
+  (should (equal "/:" (compat-call file-name-quote "/:")))
+  (should (equal "/:a" (compat-call file-name-quote "a")))
+  (should (equal "/::a" (compat-call file-name-quote ":a")))
+  (should (equal "/:/a" (compat-call file-name-quote "/a")))
+  (should (equal "/:a" (compat-call file-name-quote "/:a")))
+  (should (equal (concat "/ssh:" (system-name) ":/:a") (compat-call 
file-name-quote "/ssh::a"))))
 
 (ert-deftest file-name-with-extension ()
   (should (equal "file.ext" (file-name-with-extension "file" "ext")))
diff --git a/compat.texi b/compat.texi
index 6f85e54832..1f96cd0a96 100644
--- a/compat.texi
+++ b/compat.texi
@@ -914,41 +914,6 @@ Processes,,,elisp}), and as the program to run on the 
remote host.  If
 @xref{Magic File Names,,,elisp}.
 @end defun
 
-@c copied from lispref/files.texi
-@defmac file-name-quoted-p name
-This macro returns non-@code{nil}, when @var{name} is quoted with the
-prefix @samp{/:}.  If @var{name} is a remote file name, the local part
-of @var{name} is checked.
-
-@xref{File Name Expansion,,,elisp}.
-@end defmac
-
-@c copied from lispref/files.texi
-@defmac file-name-quote name
-This macro adds the quotation prefix @samp{/:} to the file @var{name}.
-For a local file @var{name}, it prefixes @var{name} with @samp{/:}.  If
-@var{name} is a remote file name, the local part of @var{name}
-(@pxref{Magic File Names,,,elisp}) is quoted.  If @var{name} is already
-a quoted file name, @var{name} is returned unchanged.
-
-@example
-@group
-(substitute-in-file-name (file-name-quote "bar/~/foo")) @result{}
-     "/:bar/~/foo"
-@end group
-
-@group
-(substitute-in-file-name (file-name-quote "/ssh:host:bar/~/foo"))
-     @result{} "/ssh:host:/:bar/~/foo"
-@end group
-@end example
-
-The macro cannot be used to suppress file name handlers from magic file
-names (@pxref{Magic File Names,,,elisp}).
-
-@xref{File Name Expansion,,,elisp}.
-@end defmac
-
 @defun read-multiple-choice prompt choices &optional help-string show-help 
long-form
 Ask user a multiple choice question.  @var{prompt} should be a string
 that will be displayed as the prompt.
@@ -1144,6 +1109,41 @@ The compatibility version handles the optional arguments 
@var{trim-left}
 and @var{trim-right}.
 @end defun
 
+@c copied from lispref/files.texi
+@defun compat-call@ file-name-quoted-p name
+This macro returns non-@code{nil}, when @var{name} is quoted with the
+prefix @samp{/:}.  If @var{name} is a remote file name, the local part
+of @var{name} is checked.
+
+@xref{File Name Expansion,,,elisp}.
+@end defun
+
+@c copied from lispref/files.texi
+@defun compat-call@ file-name-quote name
+This macro adds the quotation prefix @samp{/:} to the file @var{name}.
+For a local file @var{name}, it prefixes @var{name} with @samp{/:}.  If
+@var{name} is a remote file name, the local part of @var{name}
+(@pxref{Magic File Names,,,elisp}) is quoted.  If @var{name} is already
+a quoted file name, @var{name} is returned unchanged.
+
+@example
+@group
+(substitute-in-file-name (compat-call file-name-quote "bar/~/foo")) @result{}
+     "/:bar/~/foo"
+@end group
+
+@group
+(substitute-in-file-name (compat-call file-name-quote "/ssh:host:bar/~/foo"))
+     @result{} "/ssh:host:/:bar/~/foo"
+@end group
+@end example
+
+The macro cannot be used to suppress file name handlers from magic file
+names (@pxref{Magic File Names,,,elisp}).
+
+@xref{File Name Expansion,,,elisp}.
+@end defun
+
 @subsection Missing Definitions
 Compat does not provide support for the following Lisp features
 implemented in 26.1:



reply via email to

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