unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Noam Postavsky <npostavs@gmail.com>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <87o90hypyo.fsf@gmx.de> (raw)
In-Reply-To: <20190725223624.B5F4920C06@vcs0.savannah.gnu.org> (Noam Postavsky's message of "Thu, 25 Jul 2019 18:36:24 -0400 (EDT)")

npostavs@gmail.com (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.



       reply	other threads:[~2019-08-22 19:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190725223622.30077.68533@vcs0.savannah.gnu.org>
     [not found] ` <20190725223624.B5F4920C06@vcs0.savannah.gnu.org>
2019-08-22 19:12   ` Michael Albinus [this message]
2019-08-23  0:54     ` emacs-26 b3e2073 4/4: Fix subproc listening when setting filter to non-t (Bug#36591) Noam Postavsky
2019-08-24 16:21       ` Noam Postavsky
2019-08-24 18:28         ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o90hypyo.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).