bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22027: 25.1.50; Return uncorrupted default string


From: Tino Calancha
Subject: bug#22027: 25.1.50; Return uncorrupted default string
Date: Mon, 5 Jun 2017 09:39:38 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)



On Mon, 5 Jun 2017, Tino Calancha wrote:

We might add a test as well:
but my previous test is wrong: it works before we apply any patch :-)
The following looks right:

commit 3b255c1b04a87442fc8293323f2c827dd44b038a
Author: Tino Calancha <address@hidden>
Date:   Mon Jun 5 09:35:29 2017 +0900

    * test/lisp/subr-tests.el (subr-tests-bug22027): Add test.

diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index c0bfd40f80..54f4ab5d1b 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -28,6 +28,7 @@
 ;;; Code:

 (require 'ert)
+(eval-when-compile (require 'cl-lib))

 (ert-deftest let-when-compile ()
   ;; good case
@@ -316,5 +317,14 @@ subr-tests--this-file
   (should-not (method-files 'subr-tests--undefined-generic))
   (should-not (method-files 'subr-tests--generic-without-methods)))

+(ert-deftest subr-tests-bug22027 ()
+  "Test for http://debbugs.gnu.org/22027 ."
+  (let ((default "foo") res)
+    (cl-letf (((symbol-function 'read-string)
+               (lambda (_prompt _init _hist def) def)))
+      (setq res (read-passwd "pass: " 'confirm (mapconcat #'string default 
"")))
+      (should (string= default res)))))
+
+
 (provide 'subr-tests)
 ;;; subr-tests.el ends here





reply via email to

[Prev in Thread] Current Thread [Next in Thread]