Up: Defining Tests   [Index]


K.5.1.1 ert-deftest

Function: ert-defest test-name () docstring body

Define a test named TEST-NAME. Test names are in a namespace separate from functions and variables but by convention should have a prefix that indicates which package they belong to. The parentheses are not used (no parameters are allowed).

DOCSTRING is a string that explains the test. This string is displayed when a test fails.

Place tests in BODY, usually using the macro should, which is basically an assert with good error reporting.