The explicit `nil's actually don't break the previously introduced
functionality. As (stringp nil) is `nil', it was interpreted as a
missing DOCSTRING.
However, they now contain only noise.
This commit removes mtt-define-test's explicit DOCSTRING argument and
instead inspects the first entry of the given ARGS:
- if (car args) is a string, it is interpreted as a DOCSTRING
- otherwise, it is considered to be part of the test's BODY
Examples:
;; No docstring
(macroexpand-1
'(mtt-define-test trivial-check
(should (= 1 1))))
=> (ert-deftest mtt-trivial-check nil "Test that `trivial-check' does the right thing." (should (= 1 1)))
;; With docstring
(macroexpand-1
'(mtt-define-test trivial-check-with-docstring
"This tests a trivial thing."
(should (= 1 1))))
=> (ert-deftest mtt-trivial-check-with-docstring nil "This tests a trivial thing." (should (= 1 1)))
mtt-define-test's own docstring follows the usual \(fn ARGLIST)
feature used for macros, see "(elisp) Function Documentation".