GNU bug report logs - #38825
28.0.50; make check does not finish

Previous Next

Package: emacs;

Reported by: dick.r.chiang <at> gmail.com

Date: Mon, 30 Dec 2019 22:00:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38825 in the body.
You can then email your comments to 38825 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#38825; Package emacs. (Mon, 30 Dec 2019 22:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to dick.r.chiang <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 30 Dec 2019 22:00:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: dick.r.chiang <at> gmail.com
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: no subject
Date: Mon, 30 Dec 2019 16:58:57 -0500
[0001-Terminate-comint-password-function-tests.patch (text/x-diff, inline)]
From 7d9c0dd38e1581070adaa55fc1e6d4d99133c395 Mon Sep 17 00:00:00 2001
From: dickmao <none>
Date: Mon, 30 Dec 2019 16:35:28 -0500
Subject: [PATCH] Terminate `comint-password-function' tests

* test/lisp/comint-tests.el (comint-test-no-password-function,
comint-test-password-function-with-value,
comint-test-password-function-with-nil): refactor
(comint-tests/test-password-function): actually test
`comint-send-invisible' and inhibit inadvertent interactive query
---
 test/lisp/comint-tests.el | 77 +++++++++++----------------------------
 1 file changed, 21 insertions(+), 56 deletions(-)

diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el
index c04134599f..29787d980d 100644
--- a/test/lisp/comint-tests.el
+++ b/test/lisp/comint-tests.el
@@ -52,73 +52,38 @@ comint-testsuite-password-strings
   (dolist (str comint-testsuite-password-strings)
     (should (string-match comint-password-prompt-regexp str))))
 
-(ert-deftest comint-test-no-password-function ()
-  "Test that `comint-password-function' not being set does not
-alter normal password flow."
-  (cl-letf
-      (((symbol-function 'read-passwd)
-        (lambda (_prompt &optional _confirm _default)
-          "PaSsWoRd123")))
-    (let ((cat (executable-find "cat")))
-      (when cat
+(defun comint-tests/test-password-function (password-function)
+  "PASSWORD-FUNCTION can return nil or a string."
+  (when-let ((cat (executable-find "cat")))
+    (let ((comint-password-function password-function))
+      (cl-letf (((symbol-function 'read-passwd)
+                 (lambda (&rest _args) "non-nil")))
         (with-temp-buffer
           (make-comint-in-buffer "test-comint-password" (current-buffer) cat)
           (let ((proc (get-buffer-process (current-buffer))))
-            (comint-send-string proc "Password: ")
-            (accept-process-output proc 0 1 t)
-            (comint-send-eof)
-            (accept-process-output proc 0 1 t)
-            (should (string-equal (buffer-substring-no-properties (point-min) (point-max))
-                                  "Password: PaSsWoRd123\n"))
-            (when (process-live-p proc)
-              (kill-process proc))
-            (accept-process-output proc 0 1 t)))))))
+            (set-process-query-on-exit-flag proc nil)
+            (comint-send-invisible "Password: ")
+            (accept-process-output proc 0.1)
+            (should (string-equal
+                     (buffer-substring-no-properties (point-min) (point-max))
+                     (concat (or (and password-function
+                                      (funcall password-function))
+                                 "non-nil") "\n")))))))))
+
+(ert-deftest comint-test-no-password-function ()
+  "Test that `comint-password-function' not being set does not
+alter normal password flow."
+  (comint-tests/test-password-function nil))
 
 (ert-deftest comint-test-password-function-with-value ()
   "Test that `comint-password-function' alters normal password
 flow.  Hook function returns alternative password."
-  (cl-letf
-      (((symbol-function 'read-passwd)
-        (lambda (_prompt &optional _confirm _default)
-          "PaSsWoRd123")))
-    (let ((cat (executable-find "cat"))
-          (comint-password-function (lambda (_prompt) "MaGiC-PaSsWoRd789")))
-      (when cat
-        (with-temp-buffer
-          (make-comint-in-buffer "test-comint-password" (current-buffer) cat)
-          (let ((proc (get-buffer-process (current-buffer))))
-            (comint-send-string proc "Password: ")
-            (accept-process-output proc 0 1 t)
-            (comint-send-eof)
-            (accept-process-output proc 0 1 t)
-            (should (string-equal (buffer-substring-no-properties (point-min) (point-max))
-                                  "Password: MaGiC-PaSsWoRd789\n"))
-            (when (process-live-p proc)
-              (kill-process proc))
-            (accept-process-output proc 0 1 t)))))))
+  (comint-tests/test-password-function (lambda (&rest _args) "MaGiC-PaSsWoRd789")))
 
 (ert-deftest comint-test-password-function-with-nil ()
   "Test that `comint-password-function' does not alter the normal
 password flow if it returns a nil value."
-  (cl-letf
-      (((symbol-function 'read-passwd)
-        (lambda (_prompt &optional _confirm _default)
-          "PaSsWoRd456")))
-    (let ((cat (executable-find "cat"))
-          (comint-password-function (lambda (_prompt) nil)))
-      (when cat
-        (with-temp-buffer
-          (make-comint-in-buffer "test-comint-password" (current-buffer) cat)
-          (let ((proc (get-buffer-process (current-buffer))))
-            (comint-send-string proc "Password: ")
-            (accept-process-output proc 0 1 t)
-            (comint-send-eof)
-            (accept-process-output proc 0 1 t)
-            (should (string-equal (buffer-substring-no-properties (point-min) (point-max))
-                                  "Password: PaSsWoRd456\n"))
-            (when (process-live-p proc)
-              (kill-process proc))
-            (accept-process-output proc 0 1 t)))))))
+  (comint-tests/test-password-function #'ignore))
 
 ;; Local Variables:
 ;; no-byte-compile: t
-- 
2.23.0





Changed bug title to '28.0.50; make check does not finish' from 'no subject' Request was from dick <dick.r.chiang <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 31 Dec 2019 05:52:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38825; Package emacs. (Sun, 20 Sep 2020 10:45:02 GMT) Full text and rfc822 format available.

Message #10 received at 38825 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: dick.r.chiang <at> gmail.com
Cc: 38825 <at> debbugs.gnu.org
Subject: Re: bug#38825: no subject
Date: Sun, 20 Sep 2020 12:43:58 +0200
dick.r.chiang <at> gmail.com writes:

> From: dickmao <none>
> Date: Mon, 30 Dec 2019 16:35:28 -0500
> Subject: [PATCH] Terminate `comint-password-function' tests
>
> * test/lisp/comint-tests.el (comint-test-no-password-function,
> comint-test-password-function-with-value,
> comint-test-password-function-with-nil): refactor
> (comint-tests/test-password-function): actually test
> `comint-send-invisible' and inhibit inadvertent interactive query

Thanks; applied to Emacs 28.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 20 Sep 2020 10:45:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 38825 <at> debbugs.gnu.org and dick.r.chiang <at> gmail.com Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 20 Sep 2020 10:45:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Oct 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 188 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.