From 695d50fa0a11c6bd98f9f4a9b5a2905d33282316 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 5 Jun 2017 09:35:29 +0900 Subject: [PATCH] * test/lisp/subr-tests.el (subr-tests-bug22027): Add test. --- test/lisp/subr-tests.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index c0bfd40f806..54f4ab5d1b2 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 @@ cf. Bug#25477." (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 -- 2.39.2