1 ;;; bytecomp-testsuite.el
3 ;; Copyright (C) 2010 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: " ; knit
38 "Kerberos password for devnull/root <at> GNU.ORG: " ; ksu
39 "Enter passphrase: " ; ssh-add
40 "Enter passphrase (empty for no passphrase): " ; ssh-keygen
41 "Enter same passphrase again: " ; ssh-keygen
42 "Passphrase for key root@GNU.ORG: " ; plink
43 "[sudo] password for user:" ; Ubuntu sudo
47 (dolist (str password-strings
)
48 (unless (string-match comint-password-prompt-regexp str
)
50 (princ (format " ERROR: comint-password-prompt-regexp did not match %s\n"
53 (princ "FAILED: comint-password-prompt-regexp test\n")
54 (princ "PASSED: comint-password-prompt-regexp test\n"))))
56 (provide 'comint-testsuite
)
58 ;;; comint-testsuite.el ends here