1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

; Add another test for 'eshell-batch-script'

* lisp/eshell/em-script.el (eshell-close-target): New function.

* test/lisp/eshell/em-script-tests.el (em-script-test/batch-file): New
test; rename old one to...
(em-script-test/batch-file/shebang): ... this.
This commit is contained in:
Jim Porter 2024-06-09 11:53:29 -07:00
parent 0aed6f5f0d
commit b91b81957c
2 changed files with 16 additions and 0 deletions

View file

@ -116,6 +116,18 @@
(ert-deftest em-script-test/batch-file ()
"Test running an Eshell script file as a batch script."
(skip-unless (not (memq system-type '(windows-nt ms-dos))))
(ert-with-temp-file temp-file
:text "echo hi"
(with-temp-buffer
(with-temp-eshell-settings
(call-process (expand-file-name invocation-name invocation-directory)
nil '(t nil) nil
"--batch" "-f" "eshell-batch-file" temp-file))
(should (equal (buffer-string) "hi\n")))))
(ert-deftest em-script-test/batch-file/shebang ()
"Test running an Eshell script file as a batch script via a shebang."
(skip-unless (not (memq system-type '(windows-nt ms-dos))))
(ert-with-temp-file temp-file
:text (format
"#!/usr/bin/env -S %s --batch -f eshell-batch-file\necho hi"