aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-05-08 17:43:07 -0400
committerChong Yidong2011-05-08 17:43:07 -0400
commitc4c205d05ae6a67eee75d587beea00bd0a49df7e (patch)
treef73705f5a1373fa625c7d030368ebec79fbb1513
parent027f966de45d5cbcc01e3ee5ac9a667908ea3f54 (diff)
downloademacs-c4c205d05ae6a67eee75d587beea00bd0a49df7e.tar.gz
emacs-c4c205d05ae6a67eee75d587beea00bd0a49df7e.zip
Convert test/comint-testsuite.el to ERT format.
-rw-r--r--test/ChangeLog6
-rw-r--r--test/automated/comint-testsuite.el52
-rw-r--r--test/automated/font-parse-tests.el4
-rw-r--r--test/comint-testsuite.el60
4 files changed, 62 insertions, 60 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index e48862a104c..d050a19c19a 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
12011-05-08 Chong Yidong <cyd@stupidchicken.com>
2
3 * automated/font-parse-tests.el: Don't byte-compile.
4
5 * automated/comint-testsuite.el: Move from test/. Convert to ERT.
6
12011-03-10 Stefan Monnier <monnier@iro.umontreal.ca> 72011-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * automated/lexbind-tests.el: New file. 9 * automated/lexbind-tests.el: New file.
diff --git a/test/automated/comint-testsuite.el b/test/automated/comint-testsuite.el
new file mode 100644
index 00000000000..4b2d3896407
--- /dev/null
+++ b/test/automated/comint-testsuite.el
@@ -0,0 +1,52 @@
1;;; comint-testsuite.el
2
3;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
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.
11
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.
16
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/>.
19
20;;; Commentary:
21
22;; Tests for comint and related modes.
23
24;;; Code:
25
26(require 'comint)
27(require 'ert)
28
29(defvar comint-testsuite-password-strings
30 '("foo@example.net's password: " ;ssh
31 "Password for foo@example.org: " ; kinit
32 "Please enter the password for foo@example.org: " ; kinit
33 "Kerberos password for devnull/root <at> GNU.ORG: " ; ksu
34 "Enter passphrase: " ; ssh-add
35 "Enter passphrase (empty for no passphrase): " ; ssh-keygen
36 "Enter same passphrase again: " ; ssh-keygen
37 "Passphrase for key root@GNU.ORG: " ; plink
38 "[sudo] password for user:" ; Ubuntu sudo
39 "Password (again):"
40 "Enter password:")
41 "List of strings that should match `comint-password-prompt-regexp'.")
42
43(ert-deftest comint-test-password-regexp ()
44 "Test `comint-password-prompt-regexp' against common password strings."
45 (dolist (str comint-testsuite-password-strings)
46 (should (string-match comint-password-prompt-regexp str))))
47
48;; Local Variables:
49;; no-byte-compile: t
50;; End:
51
52;;; comint-testsuite.el ends here
diff --git a/test/automated/font-parse-tests.el b/test/automated/font-parse-tests.el
index 463d0f98bb3..5ba8ad2be32 100644
--- a/test/automated/font-parse-tests.el
+++ b/test/automated/font-parse-tests.el
@@ -158,4 +158,8 @@ expected font properties from parsing NAME.")
158 (insert "\n")))) 158 (insert "\n"))))
159 (goto-char (point-min))) 159 (goto-char (point-min)))
160 160
161;; Local Variables:
162;; no-byte-compile: t
163;; End:
164
161;;; font-parse-tests.el ends here. 165;;; font-parse-tests.el ends here.
diff --git a/test/comint-testsuite.el b/test/comint-testsuite.el
deleted file mode 100644
index 262ac284790..00000000000
--- a/test/comint-testsuite.el
+++ /dev/null
@@ -1,60 +0,0 @@
1;;; bytecomp-testsuite.el
2
3;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
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.
11
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.
16
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/>.
19
20;;; Commentary:
21
22;; Tests for comint and related modes.
23
24;;; Code:
25
26(require 'comint)
27
28(defun comint-testsuite-run ()
29 (interactive)
30 (with-output-to-temp-buffer "*comint test*"
31 (comint-testsuite--test-comint-password-prompt-regexp)))
32
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"))))
56
57(provide 'comint-testsuite)
58
59;;; comint-testsuite.el ends here
60