summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-06-27 11:11:28 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-06-27 11:11:28 -0400
commitd5c6faf921772e523fc224333d8af142c830a7e6 (patch)
treec56d324652a27862cad6eaa553017b6f8ffef5c1 /test
parent7b953864bad04a37e9cc0e0de4328caf1b4c400e (diff)
downloademacs-d5c6faf921772e523fc224333d8af142c830a7e6.tar.gz
* lisp/emacs-lisp/cl.el (flet): Mark obsolete.
* lisp/emacs-lisp/cl-macs.el (cl-flet*): New macro. * lisp/vc/vc-rcs.el (vc-rcs-annotate-command, vc-rcs-parse): * lisp/progmodes/js.el (js-c-fill-paragraph): * lisp/progmodes/ebrowse.el (ebrowse-switch-member-buffer-to-sibling-class) (ebrowse-switch-member-buffer-to-derived-class): * test/automated/ert-x-tests.el (ert-test-run-tests-interactively-2): * lisp/play/5x5.el (5x5-solver): Use cl-flet. Fixes: debbugs:11780
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog15
-rw-r--r--test/automated/ert-x-tests.el146
2 files changed, 83 insertions, 78 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index ddd26bf492a..45fc70e0440 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,7 +1,12 @@
+2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * automated/ert-x-tests.el (ert-test-run-tests-interactively-2):
+ Use cl-flet.
+
2012-06-08 Ulf Jasper <ulf.jasper@web.de>
- * automated/icalendar-tests.el (icalendar--parse-vtimezone): Test
- escaped commas in TZID (Bug#11473).
+ * automated/icalendar-tests.el (icalendar--parse-vtimezone):
+ Test escaped commas in TZID (Bug#11473).
(icalendar-import-with-timezone): New.
(icalendar-real-world): Add new testcase as given in the bugreport
of Bug#11473.
@@ -332,8 +337,8 @@
2009-12-18 Ulf Jasper <ulf.jasper@web.de>
* icalendar-testsuite.el
- (icalendar-testsuite--run-function-tests): Add
- icalendar-testsuite--test-parse-vtimezone.
+ (icalendar-testsuite--run-function-tests):
+ Add icalendar-testsuite--test-parse-vtimezone.
(icalendar-testsuite--test-parse-vtimezone): New.
(icalendar-testsuite--do-test-cycle): Doc changes.
(icalendar-testsuite--run-real-world-tests): Remove trailing
@@ -375,7 +380,7 @@
2008-10-31 Ulf Jasper <ulf.jasper@web.de>
* icalendar-testsuite.el (icalendar-testsuite--run-function-tests):
- Added `icalendar-testsuite--test-create-uid'.
+ Add `icalendar-testsuite--test-create-uid'.
(icalendar-testsuite--test-create-uid): New.
2008-06-14 Ulf Jasper <ulf.jasper@web.de>
diff --git a/test/automated/ert-x-tests.el b/test/automated/ert-x-tests.el
index bb05608e418..520502bb307 100644
--- a/test/automated/ert-x-tests.el
+++ b/test/automated/ert-x-tests.el
@@ -103,79 +103,79 @@
(ert-deftest ert-test-run-tests-interactively-2 ()
:tags '(:causes-redisplay)
- (let ((passing-test (make-ert-test :name 'passing-test
- :body (lambda () (ert-pass))))
- (failing-test (make-ert-test :name 'failing-test
- :body (lambda ()
- (ert-info ((propertize "foo\nbar"
- 'a 'b))
- (ert-fail
- "failure message"))))))
- (let ((ert-debug-on-error nil))
- (let* ((buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
- (messages nil)
- (mock-message-fn
- (lambda (format-string &rest args)
- (push (apply #'format format-string args) messages))))
- (flet ((expected-string (with-font-lock-p)
- (ert-propertized-string
- "Selector: (member <passing-test> <failing-test>)\n"
- "Passed: 1\n"
- "Failed: 1 (1 unexpected)\n"
- "Total: 2/2\n\n"
- "Started at:\n"
- "Finished.\n"
- "Finished at:\n\n"
- `(category ,(button-category-symbol
- 'ert--results-progress-bar-button)
- button (t)
- face ,(if with-font-lock-p
- 'ert-test-result-unexpected
- 'button))
- ".F" nil "\n\n"
- `(category ,(button-category-symbol
- 'ert--results-expand-collapse-button)
- button (t)
- face ,(if with-font-lock-p
- 'ert-test-result-unexpected
- 'button))
- "F" nil " "
- `(category ,(button-category-symbol
- 'ert--test-name-button)
- button (t)
- ert-test-name failing-test)
- "failing-test"
- nil "\n Info: " '(a b) "foo\n"
- nil " " '(a b) "bar"
- nil "\n (ert-test-failed \"failure message\")\n\n\n"
- )))
- (save-window-excursion
- (unwind-protect
- (let ((case-fold-search nil))
- (ert-run-tests-interactively
- `(member ,passing-test ,failing-test) buffer-name
- mock-message-fn)
- (should (equal messages `(,(concat
- "Ran 2 tests, 1 results were "
- "as expected, 1 unexpected"))))
- (with-current-buffer buffer-name
- (font-lock-mode 0)
- (should (ert-equal-including-properties
- (ert-filter-string (buffer-string)
- '("Started at:\\(.*\\)$" 1)
- '("Finished at:\\(.*\\)$" 1))
- (expected-string nil)))
- ;; `font-lock-mode' only works if interactive, so
- ;; pretend we are.
- (let ((noninteractive nil))
- (font-lock-mode 1))
- (should (ert-equal-including-properties
- (ert-filter-string (buffer-string)
- '("Started at:\\(.*\\)$" 1)
- '("Finished at:\\(.*\\)$" 1))
- (expected-string t)))))
- (when (get-buffer buffer-name)
- (kill-buffer buffer-name)))))))))
+ (let* ((passing-test (make-ert-test :name 'passing-test
+ :body (lambda () (ert-pass))))
+ (failing-test (make-ert-test :name 'failing-test
+ :body (lambda ()
+ (ert-info ((propertize "foo\nbar"
+ 'a 'b))
+ (ert-fail
+ "failure message")))))
+ (ert-debug-on-error nil)
+ (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
+ (messages nil)
+ (mock-message-fn
+ (lambda (format-string &rest args)
+ (push (apply #'format format-string args) messages))))
+ (cl-flet ((expected-string (with-font-lock-p)
+ (ert-propertized-string
+ "Selector: (member <passing-test> <failing-test>)\n"
+ "Passed: 1\n"
+ "Failed: 1 (1 unexpected)\n"
+ "Total: 2/2\n\n"
+ "Started at:\n"
+ "Finished.\n"
+ "Finished at:\n\n"
+ `(category ,(button-category-symbol
+ 'ert--results-progress-bar-button)
+ button (t)
+ face ,(if with-font-lock-p
+ 'ert-test-result-unexpected
+ 'button))
+ ".F" nil "\n\n"
+ `(category ,(button-category-symbol
+ 'ert--results-expand-collapse-button)
+ button (t)
+ face ,(if with-font-lock-p
+ 'ert-test-result-unexpected
+ 'button))
+ "F" nil " "
+ `(category ,(button-category-symbol
+ 'ert--test-name-button)
+ button (t)
+ ert-test-name failing-test)
+ "failing-test"
+ nil "\n Info: " '(a b) "foo\n"
+ nil " " '(a b) "bar"
+ nil "\n (ert-test-failed \"failure message\")\n\n\n"
+ )))
+ (save-window-excursion
+ (unwind-protect
+ (let ((case-fold-search nil))
+ (ert-run-tests-interactively
+ `(member ,passing-test ,failing-test) buffer-name
+ mock-message-fn)
+ (should (equal messages `(,(concat
+ "Ran 2 tests, 1 results were "
+ "as expected, 1 unexpected"))))
+ (with-current-buffer buffer-name
+ (font-lock-mode 0)
+ (should (ert-equal-including-properties
+ (ert-filter-string (buffer-string)
+ '("Started at:\\(.*\\)$" 1)
+ '("Finished at:\\(.*\\)$" 1))
+ (expected-string nil)))
+ ;; `font-lock-mode' only works if interactive, so
+ ;; pretend we are.
+ (let ((noninteractive nil))
+ (font-lock-mode 1))
+ (should (ert-equal-including-properties
+ (ert-filter-string (buffer-string)
+ '("Started at:\\(.*\\)$" 1)
+ '("Finished at:\\(.*\\)$" 1))
+ (expected-string t)))))
+ (when (get-buffer buffer-name)
+ (kill-buffer buffer-name)))))))
(ert-deftest ert-test-describe-test ()
"Tests `ert-describe-test'."