summaryrefslogtreecommitdiff
path: root/test/automated/occur-tests.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-06-24 19:24:32 -0700
committerGlenn Morris <rgm@gnu.org>2013-06-24 19:24:32 -0700
commit51f853872f483e5726dda134a25c3c73bc712c2c (patch)
tree6ef0b9382ade37b50ba20800b8e9ac09933d11bb /test/automated/occur-tests.el
parent7e3a3bb3072b68d94d1a023d3baa2bfa68c6c514 (diff)
downloademacs-51f853872f483e5726dda134a25c3c73bc712c2c.tar.gz
* 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.
Diffstat (limited to 'test/automated/occur-tests.el')
-rw-r--r--test/automated/occur-tests.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/automated/occur-tests.el b/test/automated/occur-tests.el
index c690f4ada20..306803b7567 100644
--- a/test/automated/occur-tests.el
+++ b/test/automated/occur-tests.el
@@ -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)