[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-26 b3e2073 4/4: Fix subproc listening when setting filter to n
From: |
Michael Albinus |
Subject: |
Re: emacs-26 b3e2073 4/4: Fix subproc listening when setting filter to non-t (Bug#36591) |
Date: |
Thu, 22 Aug 2019 21:12:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
address@hidden (Noam Postavsky) writes:
Hi Noam,
> --- a/test/src/process-tests.el
> +++ b/test/src/process-tests.el
> @@ -144,6 +144,35 @@
> (should (equal "hello stderr!\n"
> (mapconcat #'identity (nreverse stderr-output) "")))))
>
> +(ert-deftest set-process-filter-t ()
> + "Test setting process filter to t and back." ;; Bug#36591
> + (with-temp-buffer
> + (let* ((print-level nil)
> + (print-length nil)
> + (proc (start-process
> + "test proc" (current-buffer)
> + (concat invocation-directory invocation-name)
> + "-Q" "--batch" "--eval"
> + (prin1-to-string
> + '(let (s)
> + (while (setq s (read-from-minibuffer "$ "))
> + (princ s)
> + (princ "\n")))))))
> + (set-process-query-on-exit-flag proc nil)
> + (send-string proc "one\n")
> + (should
> + (accept-process-output proc 1)) ; Read "one".
> + (should (equal (buffer-string) "$ one\n$ "))
> + (set-process-filter proc t) ; Stop reading from proc.
> + (send-string proc "two\n")
> + (should-not
> + (accept-process-output proc 1)) ; Can't read "two" yet.
> + (should (equal (buffer-string) "$ one\n$ "))
> + (set-process-filter proc nil) ; Resume reading from proc.
> + (should
> + (accept-process-output proc 1)) ; Read "two" from proc.
> + (should (equal (buffer-string) "$ one\n$ two\n$ ")))))
This fails on emba occasionally, see for example
<https://emba.gnu.org/emacs/emacs/-/jobs/3076>.
Best regards, Michael.
- Re: emacs-26 b3e2073 4/4: Fix subproc listening when setting filter to non-t (Bug#36591),
Michael Albinus <=