diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/src/callproc-tests.el | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/src/callproc-tests.el b/test/src/callproc-tests.el new file mode 100644 index 00000000000..46541aba78c --- /dev/null +++ b/test/src/callproc-tests.el | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | ;;; callproc-tests.el --- callproc.c tests -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2016 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Code: | ||
| 21 | |||
| 22 | (require 'ert) | ||
| 23 | (eval-when-compile (require 'cl-lib)) | ||
| 24 | |||
| 25 | (ert-deftest initial-environment-preserved () | ||
| 26 | "Check that `initial-environment' is not modified by Emacs (Bug #10980)." | ||
| 27 | (skip-unless (eq system-type 'windows-nt)) | ||
| 28 | (cl-destructuring-bind (initial-shell shell) | ||
| 29 | (with-temp-buffer | ||
| 30 | (let ((process-environment (cons "SHELL" process-environment))) | ||
| 31 | (call-process (expand-file-name invocation-name invocation-directory) | ||
| 32 | nil t nil | ||
| 33 | "--batch" "-Q" "--eval" | ||
| 34 | (prin1-to-string | ||
| 35 | '(progn (prin1 (getenv-internal "SHELL" initial-environment)) | ||
| 36 | (prin1 (getenv-internal "SHELL")))))) | ||
| 37 | (split-string-and-unquote (buffer-string))) | ||
| 38 | (should (equal initial-shell "nil")) | ||
| 39 | (should-not (equal initial-shell shell)))) | ||