From: Tino Calancha Date: Mon, 5 Jun 2017 00:35:29 +0000 (+0900) Subject: * test/lisp/subr-tests.el (subr-tests-bug22027): Add test. X-Git-Tag: emacs-26.0.90~521^2~161 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=695d50fa0a11c6bd98f9f4a9b5a2905d33282316;p=emacs.git * 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 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