Skip to content

Commit b05b494

Browse files
committed
Support space and backslash characters in runfile filenames.
Bazel supports them with bazelbuild/bazel#23331. Step 1: support them for directory-based runfiles. This doesn’t require any code changes, just adapt the test.
1 parent 7d138ff commit b05b494

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

elisp/runfiles/runfiles-test.el

+7-5
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,18 @@
3737
(should (or (getenv "RUNFILES_DIR") (getenv "RUNFILES_MANIFEST_FILE")))))
3838

3939
(ert-deftest elisp/runfiles/special-chars/directory ()
40-
(let* ((directory (make-temp-file "runfiles-test-" :directory))
41-
(filename (expand-file-name "testäα𝐴🐈'.txt" directory))
40+
(let* ((windows (memq system-type '(ms-dos windows-nt)))
41+
(directory (make-temp-file "runfiles-test-" :directory))
42+
(filename (concat "testäα𝐴🐈' \t\n" (unless windows "\\") ".txt"))
43+
(target (expand-file-name filename directory))
4244
(runfiles (elisp/runfiles/make :manifest "/invalid.manifest"
4345
:directory directory))
4446
(coding-system-for-write 'utf-8-unix)
4547
(write-region-annotate-functions nil)
4648
(write-region-post-annotation-function nil))
47-
(write-region "contents\n" nil filename nil nil nil 'excl)
48-
(should (equal (elisp/runfiles/rlocation "testäα𝐴🐈'.txt" runfiles)
49-
filename))
49+
(ert-info (filename :prefix "File name: ")
50+
(write-region "contents\n" nil target nil nil nil 'excl)
51+
(should (equal (elisp/runfiles/rlocation filename runfiles) target)))
5052
(delete-directory directory :recursive)))
5153

5254
(ert-deftest elisp/runfiles/special-chars/manifest ()

0 commit comments

Comments
 (0)