nl-unittest is a simple unit testing framework for newLISP [1], a
modern dialect of Lisp [2].
Just load the file: nl-unittest.lsp in the main directory.
UnitTest:*verbose*trueif you want to output the whole assert expression, andnilif you want the output to be of the form=> Expected: <some-value> -> Received: <some-value>. Default value:nil.UnitTest:*continue-after-failure*trueif you want to continue testing whatever the previous test case result is, andnilotherwise. Default value:true.UnitTest:*enable-term-color*trueif you want to have colors in VT-100 compatible terminal, andnilotherwise. Default value:true.UnitTest:*report-failed*trueif you want to report failed assertions, andnilotherwise. Default value:true.UnitTest:*report-passed*trueif you want to report passed assertions, andnilotherwise. Default value:nil.
- First, load the main file
nl-unittest.lsp. You will have a defined context namedUnitTest. - Define a test case with:
(define-test (test-name params) body*). Remember to have convention fortest-nameor you might suffer from symbols conflicting. - Whenever you want to run a test case, call its in exactly the same way you call function.
- If you want to run all the test cases at the same time, name the test with the prefix
test_and call(UnitTest:run-all context-symbol).
- Fix time calculation.
- More options about output.
- Separating output and results.
- Assertions inside other forms (Done! Sun, 05 Jun 2011 00:34:31 +0700)
See COPYING for more details.
| [1] | http://www.newlisp.org |
| [2] | http://en.wikipedia.org/wiki/Lisp_(programming_language) |