Commit c4c205d0 authored by Chong Yidong's avatar Chong Yidong
Browse files

Convert test/comint-testsuite.el to ERT format.

parent 027f966d
2011-05-08 Chong Yidong <cyd@stupidchicken.com>
* automated/font-parse-tests.el: Don't byte-compile.
* automated/comint-testsuite.el: Move from test/. Convert to ERT.
2011-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
* automated/lexbind-tests.el: New file.
......
;;; bytecomp-testsuite.el
;;; comint-testsuite.el
;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
......@@ -24,37 +24,29 @@
;;; Code:
(require 'comint)
(defun comint-testsuite-run ()
(interactive)
(with-output-to-temp-buffer "*comint test*"
(comint-testsuite--test-comint-password-prompt-regexp)))
(defun comint-testsuite--test-comint-password-prompt-regexp ()
(interactive)
(let ((password-strings
'("foo@example.net's password: " ;ssh
"Password for foo@example.org: " ; kinit
"Please enter the password for foo@example.org: " ; kinit
"Kerberos password for devnull/root <at> GNU.ORG: " ; ksu
"Enter passphrase: " ; ssh-add
"Enter passphrase (empty for no passphrase): " ; ssh-keygen
"Enter same passphrase again: " ; ssh-keygen
"Passphrase for key root@GNU.ORG: " ; plink
"[sudo] password for user:" ; Ubuntu sudo
"Password (again):"
"Enter password:"))
fail)
(dolist (str password-strings)
(unless (string-match comint-password-prompt-regexp str)
(setq fail t)
(princ (format " ERROR: comint-password-prompt-regexp did not match %s\n"
str))))
(if fail
(princ "FAILED: comint-password-prompt-regexp test\n")
(princ "PASSED: comint-password-prompt-regexp test\n"))))
(provide 'comint-testsuite)
(require 'ert)
(defvar comint-testsuite-password-strings
'("foo@example.net's password: " ;ssh
"Password for foo@example.org: " ; kinit
"Please enter the password for foo@example.org: " ; kinit
"Kerberos password for devnull/root <at> GNU.ORG: " ; ksu
"Enter passphrase: " ; ssh-add
"Enter passphrase (empty for no passphrase): " ; ssh-keygen
"Enter same passphrase again: " ; ssh-keygen
"Passphrase for key root@GNU.ORG: " ; plink
"[sudo] password for user:" ; Ubuntu sudo
"Password (again):"
"Enter password:")
"List of strings that should match `comint-password-prompt-regexp'.")
(ert-deftest comint-test-password-regexp ()
"Test `comint-password-prompt-regexp' against common password strings."
(dolist (str comint-testsuite-password-strings)
(should (string-match comint-password-prompt-regexp str))))
;; Local Variables:
;; no-byte-compile: t
;; End:
;;; comint-testsuite.el ends here
......@@ -158,4 +158,8 @@ expected font properties from parsing NAME.")
(insert "\n"))))
(goto-char (point-min)))
;; Local Variables:
;; no-byte-compile: t
;; End:
;;; font-parse-tests.el ends here.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment