diff options
author | David Edmondson <dme@dme.org> | 2012-01-24 16:14:05 +0000 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-01-25 07:25:44 -0400 |
commit | 260975e8aff635b6b99db835ee8d40ec33ee916c (patch) | |
tree | 05cee5def71b7130da493278126a6a76d4919b46 /test/test-lib.el | |
parent | 2903b32f79dcf7789a2b015c48194cb40ac71462 (diff) |
test: Add `test_emacs_expect_t'.
Add a new test function to allow simpler testing of emacs
functionality.
`test_emacs_expect_t' takes one argument - a lisp expression to
evaluate. The test passes if the expression returns `t', otherwise it
fails and the output is reported to the tester.
Diffstat (limited to 'test/test-lib.el')
-rw-r--r-- | test/test-lib.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test-lib.el b/test/test-lib.el index 59c58681..96752f0b 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -83,3 +83,12 @@ nothing." (add-hook-counter 'notmuch-hello-mode-hook) (add-hook-counter 'notmuch-hello-refresh-hook) + +(defmacro notmuch-test-run (&rest body) + "Evaluate a BODY of test expressions and output the result." + `(with-temp-buffer + (let ((result (progn ,@body))) + (insert (if (stringp result) + result + (prin1-to-string result))) + (test-output)))) |