diff options
| author | Eli Zaretskii | 2015-11-05 20:12:19 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-05 20:12:19 +0200 |
| commit | 3be53aaed126e72be11a6743de6ddd51aaf96b63 (patch) | |
| tree | c2ea6be238faf342ecc091e60c0ec196230540b2 | |
| parent | 6540f6c58685c99a14ff73ac2e945733edc92608 (diff) | |
| download | emacs-3be53aaed126e72be11a6743de6ddd51aaf96b63.tar.gz emacs-3be53aaed126e72be11a6743de6ddd51aaf96b63.zip | |
Add test for bug #21831
* test/automated/process-tests.el
(start-process-should-not-modify-arguments): New test. (Bug#21831)
Suggested by Nicolas Richard <youngfrog@members.fsf.org>
| -rw-r--r-- | test/automated/process-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/automated/process-tests.el b/test/automated/process-tests.el index 58a2de7451d..4a43a013fb4 100644 --- a/test/automated/process-tests.el +++ b/test/automated/process-tests.el | |||
| @@ -142,4 +142,22 @@ | |||
| 142 | (should (equal "hello stderr!\n" | 142 | (should (equal "hello stderr!\n" |
| 143 | (mapconcat #'identity (nreverse stderr-output) ""))))) | 143 | (mapconcat #'identity (nreverse stderr-output) ""))))) |
| 144 | 144 | ||
| 145 | (ert-deftest start-process-should-not-modify-arguments () | ||
| 146 | "`start-process' must not modify its arguments in-place." | ||
| 147 | ;; See bug#21831. | ||
| 148 | (let* ((path (pcase system-type | ||
| 149 | ((or 'windows-nt 'ms-dos) | ||
| 150 | ;; Make sure the file name uses forward slashes. | ||
| 151 | ;; The original bug was that 'start-process' would | ||
| 152 | ;; convert forward slashes to backslashes. | ||
| 153 | (expand-file-name (executable-find "attrib.exe"))) | ||
| 154 | (_ "/bin//sh"))) | ||
| 155 | (samepath (copy-sequence path))) | ||
| 156 | ;; Make sure 'start-process' actually goes all the way and invokes | ||
| 157 | ;; the program. | ||
| 158 | (should (process-live-p (condition-case nil | ||
| 159 | (start-process "" nil path) | ||
| 160 | (error nil)))) | ||
| 161 | (should (equal path samepath)))) | ||
| 162 | |||
| 145 | (provide 'process-tests) | 163 | (provide 'process-tests) |