From: Stefan Kangas Date: Sat, 9 Jul 2022 08:54:01 +0000 (+0200) Subject: Improve ert-test-erts-file documentation X-Git-Tag: emacs-29.0.90~1447^2~1073 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ecb2eccad56518992426500dd8119024ea8288a8;p=emacs.git Improve ert-test-erts-file documentation * lisp/emacs-lisp/ert.el (ert-test-erts-file): Improve docstring. * doc/misc/ert.texi (erts files): Fix typo. --- diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 4dccd8edcf0..1b7f38daadf 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -822,7 +822,7 @@ that's pretty difficult to read and write, especially when the text in question is multi-line. So ert provides a function called @code{ert-test-erts-file} that takes -two parameters: The name of a specially-formatted @dfn{erts} file, and +two parameters: the name of a specially-formatted @dfn{erts} file, and (optionally) a function that performs the transform. @findex erts-mode diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 21bee4c6d8b..49b54c2d00f 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -2880,8 +2880,14 @@ To be used in the ERT results buffer." nil) (defun ert-test-erts-file (file &optional transform) - "Parse FILE as a file containing before/after parts. -TRANSFORM will be called to get from before to after." + "Parse FILE as a file containing before/after parts (an erts file). + +This function puts the \"before\" section of an .erts file into a +temporary buffer, calls the TRANSFORM function, and then compares +the result with the \"after\" section. + +See Info node `(ert) erts files' for more information on how to +write erts files." (with-temp-buffer (insert-file-contents file) (let ((gen-specs (list (cons 'dummy t)