summaryrefslogtreecommitdiff
path: root/test/lisp/files-tests.el
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2017-03-03 17:56:01 +0100
committerPhilipp Stephani <phst@google.com>2017-04-04 14:32:01 +0200
commit604eb02fff061e663e7523f45a72ecb71c2061e1 (patch)
treeb9328e9f9f6df7e82509de8ed207a8ea03716cf6 /test/lisp/files-tests.el
parentf4b50dad8d5eade04f495c693c0bca46060b25cb (diff)
downloademacs-604eb02fff061e663e7523f45a72ecb71c2061e1.tar.gz
Make subprocess functions resolve the default directory
`call-process' doesn't respect file name handlers in `default-directory', so `file-name-non-special' has to resolve them for `process-file', `start-file-process', and `shell-command' (Bug#25949). * lisp/files.el (file-name-non-special): Also resolve default directory for 'process-file', 'start-file-process', and 'shell-command'. * test/lisp/files-tests.el (files-tests--file-name-non-special--subprocess): Add unit test.
Diffstat (limited to 'test/lisp/files-tests.el')
-rw-r--r--test/lisp/files-tests.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 9d456c512b0..80bbeb1bc54 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -243,5 +243,13 @@ be $HOME."
(concat "/:/:" subdir)))))
(delete-directory dir 'recursive))))
+(ert-deftest files-tests--file-name-non-special--subprocess ()
+ "Check that Bug#25949 is fixed."
+ (skip-unless (executable-find "true"))
+ (should (eq (let ((default-directory "/:/")) (process-file "true")) 0))
+ (should (processp (let ((default-directory "/:/"))
+ (start-file-process "foo" nil "true"))))
+ (should (eq (let ((default-directory "/:/")) (shell-command "true")) 0)))
+
(provide 'files-tests)
;;; files-tests.el ends here