lisp-unit

API Reference

lisp-unit

Common Lisp library that supports unit testing.

LISP-UNIT

  • Variable *PRINT-SUMMARY*
    nil
    Print a summary of the pass, fail, and error count if non-nil.
  • Variable *PRINT-FAILURES*
    nil
    Print failure messages if non-NIL.
  • Variable *PRINT-ERRORS*
    nil
    Print error messages if non-NIL.
  • Variable *SUMMARIZE-RESULTS*
    t
    Summarize all of the unit test results.
  • Function USE-DEBUGGER (&optional (flag t))
    Use the debugger when testing, or not.
  • Function SIGNAL-RESULTS (&optional (flag t))
    Signal the results for extensibility.
  • Macro DEFINE-TEST (name &body body)
    Store the test in the test database.
  • Function LIST-TESTS (&optional (package *package*))
    Return a list of the tests in package.
  • Function TEST-DOCUMENTATION (name &optional (package *package*))
    Return the documentation for the test.
  • Function TEST-CODE (name &optional (package *package*))
    Returns the code stored for the test name.
  • Function REMOVE-TESTS (&optional (names :all) (package *package*))
    Remove individual tests or entire sets.
  • Function LIST-TAGS (&optional (package *package*))
    Return a list of the tags in package.
  • Function TAGGED-TESTS (&optional (tags :all) (package *package*))
    Return a list of the tests associated with the tags.
  • Function REMOVE-TAGS (&optional (tags :all) (package *package*))
    Remove individual tags or entire sets.
  • Macro ASSERT-EQ (expected form &rest extras)
    Assert whether expected and form are EQ.
  • Macro ASSERT-EQL (expected form &rest extras)
    Assert whether expected and form are EQL.
  • Macro ASSERT-EQUAL (expected form &rest extras)
    Assert whether expected and form are EQUAL.
  • Macro ASSERT-EQUALP (expected form &rest extras)
    Assert whether expected and form are EQUALP.
  • Macro ASSERT-ERROR (condition form &rest extras)
    Assert whether form signals condition.
  • Macro ASSERT-EXPANDS (expansion form &rest extras)
    Assert whether form expands to expansion.
  • Macro ASSERT-EQUALITY (test expected form &rest extras)
    Assert whether expected and form are equal according to test.
  • Macro ASSERT-PRINTS (output form &rest extras)
    Assert whether printing the form generates the output.
  • Macro ASSERT-NIL (form &rest extras)
    Assert whether the form is false.
  • Macro ASSERT-FALSE (form &rest extras)
    Assert whether the form is false.
  • Macro ASSERT-TRUE (form &rest extras)
    Assert whether the form is true.
  • Function TEST-NAMES (test-results-db)
    Return a list of the test names in the database.
  • Function SUMMARIZE-RESULTS (results &optional (stream *standard-output*))
    Print a summary of all results to the stream.
  • Function REDUCE-TEST-RESULTS-DBS (all-results &key merge)
    Return a new instance of TEST-RESULTS-DB which contains all of the results in the sequence RESULTS. Any conflicts are handled by the function MERGE. The lambda list for the MERGE function is (key value-1 value-2) where: KEY is the key which appears at least twice in the sequence RESULTS. VALUE-1 and VALUE-2 are the conflicting values for the given KEY. If MERGE is NIL, then an error is signalled when a conflict occurs.
  • Condition TEST-RUN-COMPLETE
    Signaled when a test run is finished.
  • Function RUN-TESTS (&optional (test-names :all) (package *package*))
    Run the specified tests in package.
  • Function RUN-TAGS (&optional (tags :all) (package *package*))
    Run the tests associated with the specified tags in package.
  • Generic-Function PRINT-FAILURES (result &optional stream)
    Report the results of the failed assertion.
  • Method PRINT-FAILURES ((result failure-result) &optional (stream *standard-output*))
    Failure header and footer output.
  • Method PRINT-FAILURES ((result failure-result) &optional (stream *standard-output*))
  • Method PRINT-FAILURES ((result error-result) &optional (stream *standard-output*))
  • Method PRINT-FAILURES ((result macro-result) &optional (stream *standard-output*))
  • Method PRINT-FAILURES ((result output-result) &optional (stream *standard-output*))
  • Method PRINT-FAILURES ((result test-result) &optional (stream *standard-output*))
    Print the failed assertions in the unit test.
  • Method PRINT-FAILURES ((results test-results-db) &optional (stream *standard-output*))
    Print all of the failure tests.
  • Generic-Function PRINT-ERRORS (result &optional stream)
    Print the error condition.
  • Method PRINT-ERRORS ((result test-result) &optional (stream *standard-output*))
    Print the error condition.
  • Method PRINT-ERRORS ((results test-results-db) &optional (stream *standard-output*))
    Print all of the error tests.
  • Function LOGICALLY-EQUAL (x y)
    Return true if x and y are both false or both true.
  • Function SET-EQUAL (list1 list2 &rest initargs &key key (test #'equal))
    Return true if every element of list1 is an element of list2 and vice versa.
  • Generic-Function RATIONAL-EQUAL (data1 data2)
    Return true if the rational data is equal.
  • Method RATIONAL-EQUAL ((data1 rational) (data2 rational))
    Return true if the rational numbers are equal.
  • Method RATIONAL-EQUAL ((data1 complex) (data2 complex))
    Return true if the complex parts are rational and equal.
  • Method RATIONAL-EQUAL ((data1 list) (data2 list))
    Return true if the lists are equal in length and element-wise equal.
  • Method RATIONAL-EQUAL ((data1 list) (data2 vector))
    Return true if the vector and the list are equal in length and element-wise equal.
  • Method RATIONAL-EQUAL ((data1 vector) (data2 list))
    Return true if the vector and the list are equal in length and element-wise equal.
  • Method RATIONAL-EQUAL ((data1 vector) (data2 vector))
    Return true if the vectors are equal in length and element-wise equal.
  • Method RATIONAL-EQUAL ((data1 array) (data2 array))
    Return true if the arrays are equal in dimension and element-wise equal.
  • Macro ASSERT-RATIONAL-EQUAL (expected form &rest extras)
  • Variable *MEASURE*
    1
  • Variable *EPSILON*
    nil
    Set the error epsilon if the defaults are not acceptable.
  • Variable *SIGNIFICANT-FIGURES*
    4
    Default to 4 significant figures.
  • Generic-Function DEFAULT-EPSILON (value)
    Return the default epsilon for the value.
  • Generic-Function RELATIVE-ERROR (exact approximate)
    Return the relative-error between the 2 quantities.
  • Generic-Function FLOAT-EQUAL (data1 data2 &optional epsilon)
    Return true if the floating point data is equal.
  • Generic-Function SUMSQ (data)
    Return the scaling parameter and the sum of the squares of the ~ data.
  • Generic-Function SUMP (data p)
    Return the scaling parameter and the sum of the powers of p of the ~ data.
  • Generic-Function NORM (data &optional measure)
    Return the element-wise norm of the data.
  • Generic-Function RELATIVE-ERROR-NORM (exact approximate &optional measure)
    Return the relative error norm
  • Generic-Function NORM-EQUAL (data1 data2 &optional epsilon measure)
    Return true if the norm of the data is equal.
  • Generic-Function SIGFIG-EQUAL (data1 data2 &optional significant-figures)
    Return true if the data have equal significant figures.
  • Generic-Function NUMERICAL-EQUAL (result1 result2 &key test)
    Return true if the results are numerically equal according to :TEST.
  • Method DEFAULT-EPSILON ((value float))
    Return a default epsilon value based on the floating point type.
  • Method DEFAULT-EPSILON ((value complex))
    Return a default epsilon value based on the complex type.
  • Method DEFAULT-EPSILON ((value list))
    Return the default epsilon based on contents of the list.
  • Method DEFAULT-EPSILON ((value vector))
    Return the default epsilon based on the contents of the vector.
  • Method DEFAULT-EPSILON ((value array))
    Return the default epsilon based on the contents of the array.
  • Method RELATIVE-ERROR ((exact float) (approximate float))
    Return the error delta between the exact and approximate floating point value.
  • Method RELATIVE-ERROR ((exact float) (approximate complex))
    Return the relative error between the float and complex number.
  • Method RELATIVE-ERROR ((exact complex) (approximate float))
    Return the relative error between the float and complex number.
  • Method RELATIVE-ERROR ((exact complex) (approximate complex))
    Return the relative error of the complex numbers.
  • Method FLOAT-EQUAL ((data1 float) (data2 float) &optional (epsilon *epsilon*))
    Return true if the relative error between data1 and data2 is less than epsilon.
  • Method FLOAT-EQUAL ((data1 float) (data2 rational) &optional (epsilon *epsilon*))
    Return true if the relative error between data1 and data2 is less than epsilon.
  • Method FLOAT-EQUAL ((data1 rational) (data2 float) &optional (epsilon *epsilon*))
    Return true if the relative error between data1 and data2 is less than epsilon.
  • Method FLOAT-EQUAL ((data1 float) (data2 complex) &optional (epsilon *epsilon*))
    Return true if the relative error between data1 and data2 is less than epsilon.
  • Method FLOAT-EQUAL ((data1 complex) (data2 float) &optional (epsilon *epsilon*))
    Return true if the relative error between data1 and data2 is less than epsilon.
  • Method FLOAT-EQUAL ((data1 complex) (data2 complex) &optional (epsilon *epsilon*))
    Return true if the relative error between data1 and data2 is less than epsilon.
  • Method FLOAT-EQUAL ((data1 list) (data2 list) &optional (epsilon *epsilon*))
    Return true if the lists are equal in length and element-wise comparison of the relative error is less than epsilon.
  • Method FLOAT-EQUAL ((data1 list) (data2 vector) &optional (epsilon *epsilon*))
    Return true if the vector and the list are equal in length and element-wise comparison of the relative error is less than epsilon.
  • Method FLOAT-EQUAL ((data1 vector) (data2 list) &optional (epsilon *epsilon*))
    Return true if the vector and the list are equal in length and element-wise comparison of the relative error is less than epsilon.
  • Method FLOAT-EQUAL ((data1 vector) (data2 vector) &optional (epsilon *epsilon*))
    Return true if the vectors are equal in length and element-wise comparison of the relative error is less than epsilon.
  • Method FLOAT-EQUAL ((data1 array) (data2 array) &optional (epsilon *epsilon*))
    Return true if the arrays are equal in length and element-wise comparison of the relative error is less than epsilon.
  • Macro ASSERT-FLOAT-EQUAL (expected form &rest extras)
  • Method SUMSQ ((data list))
    Return the scaling parameter and the sum of the squares of the ~ list.
  • Method SUMSQ ((data vector))
    Return the scaling parameter and the sum of the squares of the ~ vector.
  • Method SUMSQ ((data array))
    Return the scaling parameter and the sum of the squares of the ~ array.
  • Method SUMP ((data list) (p real))
    Return the scaling parameter and the sum of the powers of p of the ~ data.
  • Method SUMP ((data vector) (p real))
    Return the scaling parameter and the sum of the powers of p of the ~ vector.
  • Method SUMP ((data array) (p real))
    Return the scaling parameter and the sum of the powers of p of the ~ array.
  • Method NORM ((data list) &optional (measure *measure*))
    Return the norm of the list according to the measure.
  • Method NORM ((data vector) &optional (measure *measure*))
    Return the norm of the vector according to the measure.
  • Method NORM ((data array) &optional (measure *measure*))
    Return the entrywise norm of the array according to the measure.
  • Method RELATIVE-ERROR-NORM ((exact list) (approximate list) &optional (measure *measure*))
    Return the relative error norm of the lists.
  • Method RELATIVE-ERROR-NORM ((exact list) (approximate vector) &optional (measure *measure*))
    Return the relative error norm of the list and the vector.
  • Method RELATIVE-ERROR-NORM ((exact vector) (approximate list) &optional (measure *measure*))
    Return the relative error norm of the list and the vector.
  • Method RELATIVE-ERROR-NORM ((exact vector) (approximate vector) &optional (measure *measure*))
    Return the relative error norm of the vectors.
  • Method RELATIVE-ERROR-NORM ((exact array) (approximate vector) &optional (measure *measure*))
    Return the relative error norm of the arrays.
  • Method NORM-EQUAL ((data1 list) (data2 list) &optional (epsilon *epsilon*) (measure *measure*))
    Return true if the lists are equal in length and the relative error norm is less than epsilon.
  • Method NORM-EQUAL ((data1 list) (data2 vector) &optional (epsilon *epsilon*) (measure *measure*))
    Return true if the vector and the list are equal in length and the relative error norm is less than epsilon.
  • Method NORM-EQUAL ((data1 vector) (data2 list) &optional (epsilon *epsilon*) (measure *measure*))
    Return true if the vector and the list are equal in length and the relative error norm is less than epsilon.
  • Method NORM-EQUAL ((data1 vector) (data2 vector) &optional (epsilon *epsilon*) (measure *measure*))
    Return true if the vectors are equal in length and the relative error norm is less than epsilon.
  • Method NORM-EQUAL ((data1 array) (data2 array) &optional (epsilon *epsilon*) (measure *measure*))
    Return true if the arrays are equal in length and the relative error norm is less than epsilon.
  • Macro ASSERT-NORM-EQUAL (expected form &rest extras)
  • Method SIGFIG-EQUAL ((data1 float) (data2 float) &optional (significant-figures *significant-figures*))
    Return true if the floating point numbers have equal significant figures.
  • Method SIGFIG-EQUAL ((data1 list) (data2 list) &optional (significant-figures *significant-figures*))
    Return true if the lists are equal in length and the element-wise comparison is equal to significant figures.
  • Method SIGFIG-EQUAL ((data1 vector) (data2 list) &optional (significant-figures *significant-figures*))
    Return true if the vector and the list are equal in length and the element-wise comparison is equal to significant figures.
  • Method SIGFIG-EQUAL ((data1 list) (data2 vector) &optional (significant-figures *significant-figures*))
    Return true if the list and the vector are equal in length and the element-wise comparison is equal to significant figures.
  • Method SIGFIG-EQUAL ((data1 vector) (data2 vector) &optional (significant-figures *significant-figures*))
    Return true if the vectors are equal in length and the element-wise comparison is equal to significant figures.
  • Method SIGFIG-EQUAL ((data1 array) (data2 array) &optional (significant-figures *significant-figures*))
    Return true if the arrays are equal in length and the element-wise comparison is equal to significant figures.
  • Macro ASSERT-SIGFIG-EQUAL (expected form &rest extras)
  • Function NUMBER-EQUAL (number1 number2 &optional (epsilon *epsilon*) type-eq-p)
    Return true if the numbers are equal within some epsilon, optionally requiring the types to be identical.
  • Macro ASSERT-NUMBER-EQUAL (expected form &rest extras)
  • Method NUMERICAL-EQUAL ((result1 number) (result2 number) &key (test #'number-equal))
    Return true if the the numbers are equal according to :TEST.
  • Method NUMERICAL-EQUAL ((result1 list) (result2 list) &key (test #'number-equal))
    Return true if the lists are equal in length and each element is equal according to :TEST.
  • Method NUMERICAL-EQUAL ((result1 vector) (result2 vector) &key (test #'number-equal))
    Return true if the vectors are equal in length and each element is equal according to :TEST.
  • Method NUMERICAL-EQUAL ((result1 list) (result2 vector) &key (test #'number-equal))
    Return true if every element of the list is equal to the corresponding element of the vector.
  • Method NUMERICAL-EQUAL ((result1 vector) (result2 list) &key (test #'number-equal))
    Return true if every element of the list is equla to the corresponding element of the vector.
  • Method NUMERICAL-EQUAL ((result1 array) (result2 array) &key (test #'number-equal))
    Return true if the arrays are equal in dimension and each element is equal according to :TEST.
  • Macro ASSERT-NUMERICAL-EQUAL (expected form &rest extras)
  • Function ARRAY-ERROR (array1 array2 &key (test #'number-equal) (error-function #'relative-error))
    Return a list of the indices and error between the array elements.
  • Function MAKE-2D-LIST (rows columns &key (initial-element 0))
    Return a nested list with INITIAL-ELEMENT.
  • Function COMPLEX-RANDOM (limit &optional (state *random-state*))
    Return a random complex number.
  • Function MAKE-RANDOM-LIST (size &optional (limit 1.0))
    Return a list of random numbers.
  • Function MAKE-RANDOM-2D-LIST (rows columns &optional (limit 1.0))
    Return a nested list of random numbers.
  • Function MAKE-RANDOM-2D-ARRAY (rows columns &optional (limit 1.0))
    Return a 2D array of random numbers.
  • Function WRITE-TAP (test-results &optional (stream *standard-output*))
    Write the test results to `stream` in TAP format. Returns the test results.
  • Function WRITE-TAP-TO-FILE (test-results path)
    write the test results to `path` in TAP format, overwriting `path`. Returns pathname to the output file