From b05b494611ee996f5ab2752baf0d63e8fa346be0 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Tue, 8 Oct 2024 01:58:41 +0200 Subject: [PATCH] Support space and backslash characters in runfile filenames. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bazel supports them with https://github.com/bazelbuild/bazel/pull/23331. Step 1: support them for directory-based runfiles. This doesn’t require any code changes, just adapt the test. --- elisp/runfiles/runfiles-test.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/elisp/runfiles/runfiles-test.el b/elisp/runfiles/runfiles-test.el index fc1f4326..3fe6fd08 100644 --- a/elisp/runfiles/runfiles-test.el +++ b/elisp/runfiles/runfiles-test.el @@ -37,16 +37,18 @@ (should (or (getenv "RUNFILES_DIR") (getenv "RUNFILES_MANIFEST_FILE"))))) (ert-deftest elisp/runfiles/special-chars/directory () - (let* ((directory (make-temp-file "runfiles-test-" :directory)) - (filename (expand-file-name "testäα𝐴🐈'.txt" directory)) + (let* ((windows (memq system-type '(ms-dos windows-nt))) + (directory (make-temp-file "runfiles-test-" :directory)) + (filename (concat "testäα𝐴🐈' \t\n" (unless windows "\\") ".txt")) + (target (expand-file-name filename directory)) (runfiles (elisp/runfiles/make :manifest "/invalid.manifest" :directory directory)) (coding-system-for-write 'utf-8-unix) (write-region-annotate-functions nil) (write-region-post-annotation-function nil)) - (write-region "contents\n" nil filename nil nil nil 'excl) - (should (equal (elisp/runfiles/rlocation "testäα𝐴🐈'.txt" runfiles) - filename)) + (ert-info (filename :prefix "File name: ") + (write-region "contents\n" nil target nil nil nil 'excl) + (should (equal (elisp/runfiles/rlocation filename runfiles) target))) (delete-directory directory :recursive))) (ert-deftest elisp/runfiles/special-chars/manifest ()