1 ;;; bytecomp-testsuite.el
3 ;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
5 ;; This file is part of GNU Emacs.
7 ;; GNU Emacs is free software: you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation, either version 3 of the License, or
10 ;; (at your option) any later version.
12 ;; GNU Emacs is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 ;; Tests for comint and related modes.
28 (defun comint-testsuite-run ()
30 (with-output-to-temp-buffer "*comint test*"
31 (comint-testsuite--test-comint-password-prompt-regexp)))
33 (defun comint-testsuite--test-comint-password-prompt-regexp ()
35 (let ((password-strings
36 '("foo@example.net's password: " ;ssh
37 "Password for foo@example.org: " ; kinit
38 "Please enter the password for foo@example.org: " ; kinit
39 "Kerberos password for devnull/root <at> GNU.ORG: " ; ksu
40 "Enter passphrase: " ; ssh-add
41 "Enter passphrase (empty for no passphrase): " ; ssh-keygen
42 "Enter same passphrase again: " ; ssh-keygen
43 "Passphrase for key root@GNU.ORG: " ; plink
44 "[sudo] password for user:" ; Ubuntu sudo
48 (dolist (str password-strings
)
49 (unless (string-match comint-password-prompt-regexp str
)
51 (princ (format " ERROR: comint-password-prompt-regexp did not match %s\n"
54 (princ "FAILED: comint-password-prompt-regexp test\n")
55 (princ "PASSED: comint-password-prompt-regexp test\n"))))
57 (provide 'comint-testsuite
)
59 ;;; comint-testsuite.el ends here