]> git.eshelyaron.com Git - emacs.git/commitdiff
New test ffap-replace-file-component
authorStefan Kangas <stefan@marxist.se>
Thu, 28 Jul 2022 08:33:25 +0000 (10:33 +0200)
committerStefan Kangas <stefan@marxist.se>
Thu, 28 Jul 2022 08:33:31 +0000 (10:33 +0200)
* test/lisp/ffap-tests.el (ffap-replace-file-component): New test.

lisp/ffap.el
test/lisp/ffap-tests.el

index 169c64a395ec407e95da929b572a2167d6c8d86e..dc286db130d80104d101a38424129d32967dcd1e 100644 (file)
@@ -492,7 +492,6 @@ Returned values:
   (and (stringp fullname)
        (stringp name)
        (concat (file-remote-p fullname) name)))
-;; (ffap-replace-file-component "/who@foo.com:/whatever" "/new")
 
 (defun ffap-file-suffix (file)
   "Return trailing `.foo' suffix of FILE, or nil if none."
index 4b580b5af52960c7b0be89c34bf74b060189dbe0..a11af9507efdbe0f5b2f5f6fc230a2273104ef00 100644 (file)
 (require 'ert-x)
 (require 'ffap)
 
+(ert-deftest ffap-replace-file-component ()
+  (should (equal
+           (ffap-replace-file-component "/ftp:who@foo.com:/whatever" "/new")
+           "/ftp:who@foo.com:/new")))
+
 (ert-deftest ffap-tests-25243 ()
   "Test for https://debbugs.gnu.org/25243 ."
   (ert-with-temp-file file