* test/automated/occur-tests.el (occur-test-create): New function.

Use it to create separate tests for each element, so we run them
all rather than stopping at the first error.
This commit is contained in:
Glenn Morris 2013-06-24 19:24:32 -07:00
parent 7e3a3bb307
commit 51f853872f
2 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2013-06-25 Glenn Morris <rgm@gnu.org>
* automated/occur-tests.el (occur-test-create): New function.
Use it to create separate tests for each element, so we run them
all rather than stopping at the first error.
2013-06-24 Glenn Morris <rgm@fencepost.gnu.org>
* automated/occur-tests.el (occur-tests):

View file

@ -335,12 +335,18 @@ Each element has the format:
(and (buffer-name temp-buffer)
(kill-buffer temp-buffer)))))
(ert-deftest occur-tests ()
"Test the functionality of `occur'.
The test data is in the `occur-tests' constant."
(let ((occur-hook nil))
(dolist (test occur-tests)
(should (occur-test-case test)))))
(defun occur-test-create (n)
"Create a test for element N of the `occur-tests' constant."
(let ((testname (intern (format "occur-test-%.2d" n)))
(testdoc (format "Test element %d of `occur-tests'." n)))
(eval
`(ert-deftest ,testname ()
,testdoc
(let (occur-hook)
(should (occur-test-case (nth ,n occur-tests))))))))
(dotimes (i (length occur-tests))
(occur-test-create i))
(provide 'occur-tests)