Initial support for unified DVCS pull and merge.
[emacs.git] / test / comint-testsuite.el
blob9a4e7eae3b71faa38850621554a8e597b5c22cfa
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/>.
20 ;;; Commentary:
22 ;; Tests for comint and related modes.
24 ;;; Code:
26 (require 'comint)
28 (defun comint-testsuite-run ()
29 (interactive)
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 ()
34 (interactive)
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
45 "Password (again):"
46 "Enter password:"))
47 fail)
48 (dolist (str password-strings)
49 (unless (string-match comint-password-prompt-regexp str)
50 (setq fail t)
51 (princ (format " ERROR: comint-password-prompt-regexp did not match %s\n"
52 str))))
53 (if fail
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