summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2026-05-12 08:48:43 +0200
committerMichael Albinus <michael.albinus@gmx.de>2026-05-12 08:48:43 +0200
commitc68f3237bea2b38a327f891b4517bee4e317daec (patch)
treea7d476775f52265b91808e2cef230a97e10429f6 /test
parent6d347d983480c17293da0d430360d98cfc8bd805 (diff)
Fix file-name-non-special implementation of get-file-buffer
* lisp/files.el (file-name-non-special): Fix `get-file-buffer'. (Bug#80718) * test/lisp/files-tests.el (files-tests-file-name-non-special--temp-file-prefixes): Extend list. (w32-downcase-file-names): Declare. (files-tests-file-name-non-special-get-file-buffer): Adapt test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/files-tests.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 55011cd461a..822e031e0bf 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -401,7 +401,8 @@ be $HOME."
(append '("foo" "$foo" "~foo")
;; No amount of quoting will allow creation of a file name
;; with an embedded '*' on MS-Windows and MS-DOS.
- (if (not (memq system-type '(windows-nt ms-dos))) '("foo*bar")))
+ (if (not (memq system-type '(windows-nt ms-dos)))
+ '("foo*bar" "foo?bar")))
"Prefixes to be tested for `file-name-non-special' tests.")
(ert-deftest files-tests-file-name-non-special--subprocess ()
@@ -696,6 +697,8 @@ unquoted file names."
(tmpdir nospecial-dir t)
(should-error (directory-files-and-attributes nospecial-dir))))
+(defvar w32-downcase-file-names)
+
(ert-deftest files-tests-directory-files-recursively-w32 ()
"Test MS-Windows specific features of `directory-files-recursively'."
(skip-unless (eq system-type 'windows-nt))
@@ -1054,12 +1057,16 @@ unquoted file names."
(ert-deftest files-tests-file-name-non-special-get-file-buffer ()
;; Make sure these buffers don't exist.
(files-tests--with-temp-non-special (tmpfile nospecial)
+ (find-file-noselect nospecial)
(let ((fbuf (get-file-buffer nospecial)))
- (if fbuf (kill-buffer fbuf))
+ (should (get-file-buffer nospecial))
+ (kill-buffer fbuf)
(should-not (get-file-buffer nospecial))))
(files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial)
+ (find-file-noselect nospecial)
(let ((fbuf (get-file-buffer nospecial)))
- (if fbuf (kill-buffer fbuf))
+ (should (get-file-buffer nospecial))
+ (kill-buffer fbuf)
(should-not (get-file-buffer nospecial)))))
(ert-deftest files-tests-file-name-non-special-insert-directory ()