summaryrefslogtreecommitdiff
path: root/test/lisp/eshell/esh-cmd-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/eshell/esh-cmd-tests.el')
-rw-r--r--test/lisp/eshell/esh-cmd-tests.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/lisp/eshell/esh-cmd-tests.el b/test/lisp/eshell/esh-cmd-tests.el
index 70e1901c169..d8124a19af6 100644
--- a/test/lisp/eshell/esh-cmd-tests.el
+++ b/test/lisp/eshell/esh-cmd-tests.el
@@ -113,7 +113,7 @@ bug#59469."
(with-temp-eshell
(eshell-match-command-output
(format "*echo hi > #<%s> &" bufname)
- (rx "[echo" (? ".exe") "] " (+ digit) "\n"))
+ (rx bos "[echo" (? ".exe") "] " (+ digit) "\n"))
(eshell-wait-for-subprocess t))
(should (equal (buffer-string) "hi\n"))))
@@ -129,6 +129,18 @@ bug#59469."
(eshell-wait-for-subprocess t))
(should (equal (buffer-string) "olleh\n"))))
+(ert-deftest esh-cmd-test/background/kill ()
+ "Make sure that a background command that gets killed doesn't emit a prompt."
+ (skip-unless (executable-find "sleep"))
+ (let ((background-message (rx bos "[sleep" (? ".exe") "] " (+ digit) "\n")))
+ (with-temp-eshell
+ (eshell-match-command-output "*sleep 10 &" background-message)
+ (kill-process (caar eshell-process-list))
+ (eshell-wait-for-subprocess t)
+ ;; Ensure we didn't emit another prompt after killing the
+ ;; background process.
+ (should (eshell-match-output background-message)))))
+
;; Lisp forms