comint-testsuite.el 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ;;; comint-testsuite.el
  2. ;; Copyright (C) 2010-2012 Free Software Foundation, Inc.
  3. ;; This file is part of GNU Emacs.
  4. ;; GNU Emacs is free software: you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;; GNU Emacs is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;; You should have received a copy of the GNU General Public License
  13. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  14. ;;; Commentary:
  15. ;; Tests for comint and related modes.
  16. ;;; Code:
  17. (require 'comint)
  18. (require 'ert)
  19. (defvar comint-testsuite-password-strings
  20. '("foo@example.net's password: " ;ssh
  21. "Password for foo@example.org: " ; kinit
  22. "Please enter the password for foo@example.org: " ; kinit
  23. "Kerberos password for devnull/root <at> GNU.ORG: " ; ksu
  24. "Enter passphrase: " ; ssh-add
  25. "Enter passphrase (empty for no passphrase): " ; ssh-keygen
  26. "Enter same passphrase again: " ; ssh-keygen
  27. "Passphrase for key root@GNU.ORG: " ; plink
  28. "[sudo] password for user:" ; Ubuntu sudo
  29. "Password (again):"
  30. "Enter password:")
  31. "List of strings that should match `comint-password-prompt-regexp'.")
  32. (ert-deftest comint-test-password-regexp ()
  33. "Test `comint-password-prompt-regexp' against common password strings."
  34. (dolist (str comint-testsuite-password-strings)
  35. (should (string-match comint-password-prompt-regexp str))))
  36. ;; Local Variables:
  37. ;; no-byte-compile: t
  38. ;; End:
  39. ;;; comint-testsuite.el ends here