Fix 'wdired-test-unfinished-edit-01'
authorPeter Oliver <git@mavit.org.uk>
Fri, 12 Jul 2024 09:52:23 +0000 (10:52 +0100)
committerEli Zaretskii <eliz@gnu.org>
Sat, 13 Jul 2024 10:36:42 +0000 (13:36 +0300)
* test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):
Don't modify the random directory name if, by chance, it happens
to contain the substring "foo" anywhere but immediately after the
slash.  (Bug#72073)

test/lisp/wdired-tests.el

index f7bff743058b7a7a3b6f59707b49a67a029f960d..f6d2194e998026d53956d3a2e43aa35a1bcaef1d 100644 (file)
@@ -114,7 +114,7 @@ wdired-mode."
     (setq test-dir (file-truename test-dir))
     (let* ((test-file (concat (file-name-as-directory test-dir) "foo.c"))
            (replace "bar")
-           (new-file (string-replace "foo" replace test-file)))
+           (new-file (string-replace "/foo" (concat "/" replace) test-file)))
       (write-region "" nil test-file nil 'silent)
       (let ((buf (find-file-noselect test-dir)))
         (unwind-protect