summaryrefslogtreecommitdiff
path: root/test/lisp/simple-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/simple-tests.el')
-rw-r--r--test/lisp/simple-tests.el38
1 files changed, 31 insertions, 7 deletions
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index d13b8599c65..64b341bd469 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -489,13 +489,12 @@ See Bug#21722."
(should (equal pos (point))))))
(ert-deftest line-number-at-pos-when-passing-point ()
- (let (pos)
- (with-temp-buffer
- (insert "a\nb\nc\nd\n")
- (should (equal (line-number-at-pos 1) 1))
- (should (equal (line-number-at-pos 3) 2))
- (should (equal (line-number-at-pos 5) 3))
- (should (equal (line-number-at-pos 7) 4)))))
+ (with-temp-buffer
+ (insert "a\nb\nc\nd\n")
+ (should (equal (line-number-at-pos 1) 1))
+ (should (equal (line-number-at-pos 3) 2))
+ (should (equal (line-number-at-pos 5) 3))
+ (should (equal (line-number-at-pos 7) 4))))
;;; Auto fill.
@@ -511,5 +510,30 @@ See Bug#21722."
(do-auto-fill)
(should (string-equal (buffer-string) "foo bar"))))
+(ert-deftest simple-tests-async-shell-command-30280 ()
+ "Test for https://debbugs.gnu.org/30280 ."
+ :expected-result :failed
+ (let* ((async-shell-command-buffer 'new-buffer)
+ (async-shell-command-display-buffer nil)
+ (str "*Async Shell Command*")
+ (buffers-name
+ (cl-loop repeat 2
+ collect (buffer-name
+ (generate-new-buffer str))))
+ (inhibit-message t))
+ (mapc #'kill-buffer buffers-name)
+ (async-shell-command
+ (format "%s -Q -batch -eval '(progn (sleep-for 3600) (message \"foo\"))'"
+ invocation-name))
+ (async-shell-command
+ (format "%s -Q -batch -eval '(progn (sleep-for 1) (message \"bar\"))'"
+ invocation-name))
+ (let ((buffers (mapcar #'get-buffer buffers-name))
+ (processes (mapcar #'get-buffer-process buffers-name)))
+ (unwind-protect
+ (should (memq (cadr buffers) (mapcar #'window-buffer (window-list))))
+ (mapc #'delete-process processes)
+ (mapc #'kill-buffer buffers)))))
+
(provide 'simple-test)
;;; simple-test.el ends here