From: Stefan Kangas Date: Thu, 28 Jul 2022 08:33:25 +0000 (+0200) Subject: New test ffap-replace-file-component X-Git-Tag: emacs-29.0.90~1447^2~706 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=799788899628a9b34fa5d1c297d3678de0622323;p=emacs.git New test ffap-replace-file-component * test/lisp/ffap-tests.el (ffap-replace-file-component): New test. --- diff --git a/lisp/ffap.el b/lisp/ffap.el index 169c64a395e..dc286db130d 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -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." diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index 4b580b5af52..a11af9507ef 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el @@ -28,6 +28,11 @@ (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