Variable: faceup-test-explain

faceup-test-explain is a variable defined in faceup.el.gz.

Value

nil

Documentation

When non-nil, tester functions returns a text description on failure.

Of course, this only work for test functions aware of this variable, like faceup-test-equal and functions based on this function.

This is intended to be used to simplify ert explain functions, which could be defined as:

    (defun my-test (args...) ...)
    (defun my-test-explain (args...)
      (let ((faceup-test-explain t))
        (the-test args...)))
    (put 'my-test 'ert-explainer 'my-test-explain)

Alternative, you can use the macro faceup-defexplainer as follows:

    (defun my-test (args...) ...)
    (faceup-defexplainer my-test)

Test functions, like faceup-test-font-lock-buffer, built on top of faceup-test-equal, and other functions that adhere to this variable, can easily define their own explainer functions.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/faceup.el.gz
;; ----------------------------------------------------------------------
;; Regression test support
;;

(defvar faceup-test-explain nil
  "When non-nil, tester functions returns a text description on failure.

Of course, this only work for test functions aware of this
variable, like `faceup-test-equal' and functions based on this
function.

This is intended to be used to simplify `ert' explain functions,
which could be defined as:

    (defun my-test (args...) ...)
    (defun my-test-explain (args...)
      (let ((faceup-test-explain t))
        (the-test args...)))
    (put \\='my-test \\='ert-explainer \\='my-test-explain)

Alternative, you can use the macro `faceup-defexplainer' as follows:

    (defun my-test (args...) ...)
    (faceup-defexplainer my-test)

Test functions, like `faceup-test-font-lock-buffer', built on top
of `faceup-test-equal', and other functions that adhere to this
variable, can easily define their own explainer functions.")