all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#43202: patch
@ 2020-09-04 13:01 dick.r.chiang
  2020-09-04 13:29 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: dick.r.chiang @ 2020-09-04 13:01 UTC (permalink / raw)
  To: 43202

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Squashed-commit-of-the-following.patch --]
[-- Type: text/x-diff, Size: 1915 bytes --]

From 50446fc44e54a989db0863b5c8c887043e1226f9 Mon Sep 17 00:00:00 2001
From: dickmao <none>
Date: Fri, 4 Sep 2020 08:57:58 -0400
Subject: [PATCH] Squashed commit of the following:

commit 4ceb578a9c9a93ea44f61e7453aae5b8c2ed90e6
Author: dickmao <none>
Date:   Fri Sep 4 08:55:39 2020 -0400

    avoid `Wrong type argument` in `list-processes--refresh`

    Should not expect sequencep from `process-command` for network,
    serial, pipe.

* lisp/simple.el (list-processes--refresh): network, serial, *or pipe*.
* test/src/process-tests.el (process-test-stopped-pipe): add a test.
---
 lisp/simple.el            | 2 +-
 test/src/process-tests.el | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index eedbff2d08..e7eb33b200 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4374,7 +4374,7 @@ list-processes--refresh
 		    ((thread-name (process-thread p)))
 		    (t "--")))
 		  (cmd
-		   (if (memq type '(network serial))
+		   (if (memq type '(network serial pipe))
 		       (let ((contact (process-contact p t t)))
 			 (if (eq type 'network)
 			     (format "(%s %s)"
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e15ad47f96..c45b00a776 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -105,6 +105,15 @@ process-test-stderr-buffer
 	      (goto-char (point-min))
 	      (looking-at "hello stderr!")))))
 
+(ert-deftest process-test-stopped-pipe ()
+  (skip-unless (executable-find "cat"))
+  (with-temp-buffer
+    (let ((proc (make-pipe-process :name "pipe" :buffer (current-buffer)
+                                   :command '("cat") :stop t)))
+      (unwind-protect
+          (should (list-processes--refresh))
+        (delete-process proc)))))
+
 (ert-deftest process-test-stderr-filter ()
   (skip-unless (executable-find "bash"))
   (let* ((sentinel-called nil)
-- 
2.26.2






^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#43202: patch
  2020-09-04 13:01 bug#43202: patch dick.r.chiang
@ 2020-09-04 13:29 ` Lars Ingebrigtsen
  2020-09-06 21:20   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-04 13:29 UTC (permalink / raw)
  To: dick.r.chiang; +Cc: 43202

dick.r.chiang@gmail.com writes:

Looks good.  Some comments:

> * lisp/simple.el (list-processes--refresh): network, serial, *or pipe*.
> * test/src/process-tests.el (process-test-stopped-pipe): add a test.

These aren't really descriptive (and each sentence should start with a
capital letter).

> +(ert-deftest process-test-stopped-pipe ()
> +  (skip-unless (executable-find "cat"))
> +  (with-temp-buffer
> +    (let ((proc (make-pipe-process :name "pipe" :buffer (current-buffer)
> +                                   :command '("cat") :stop t)))
> +      (unwind-protect
> +          (should (list-processes--refresh))
> +        (delete-process proc)))))

I don't think this test is correct -- you're really checking that
list-processes--refresh doesn't bug out; not that it returns non-nil (it
doesn't have a well-defined return value).

So if this is to be checked for (I'm not sure it adds much value as a
test), then it should check whether it errors out or not (and the value
should be disregarded).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#43202: patch
  2020-09-04 13:29 ` Lars Ingebrigtsen
@ 2020-09-06 21:20   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-06 21:20 UTC (permalink / raw)
  To: dick.r.chiang; +Cc: 43202

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I don't think this test is correct -- you're really checking that
> list-processes--refresh doesn't bug out; not that it returns non-nil (it
> doesn't have a well-defined return value).
>
> So if this is to be checked for (I'm not sure it adds much value as a
> test), then it should check whether it errors out or not (and the value
> should be disregarded).

The bug fix itself should definitely go in, though, so I've now applied
that part.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-06 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-04 13:01 bug#43202: patch dick.r.chiang
2020-09-04 13:29 ` Lars Ingebrigtsen
2020-09-06 21:20   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.