- Provides 27 assert functions, and a few misc functions for usage in an easy unit testing framework.
- Comes with a test suite to test itself. The testsuite consists of approximately 710 assertions.
- Licensed under the MIT license.
This package is not maintained anymore. It is here for pure historically reasons for your interest.
Source: example.lua
:
require "lunit"
module( "my_testcase", lunit.testcase )
function test_success()
assert_false( false, "This test never fails.")
end
function test_failure()
fail( "This test always fails!" )
end
lunit.main(...)
Run tests:
# lua example.lua
F.
2 Assertions checked.
1) Failure (my_testcase.test_failure):
example.lua:10: failure
example.lua:10: This test always fails!
Testsuite finished (1 passed, 1 failed, 0 errors).
git clone https://github.com/mrothNET/lunit.git
- lunit no longer depends on
lunit.sh
. The script moved to the extra-directory.
- New test function
assert_error_match()
. - lunit shell script returns an error code on failed tests.
- Be more compatible with Darwin / Mac OS X.
- Bug fixes.
- Mostly complete rewrite.
- Lua-5.1 only.
- New function
lunit.wrap()
to wrap a single function in a complete test case. - Now a backtrace is printed, if an error or failure occurs in a test case.
- The test suite consists now of approximately 630 assertions.
- Fixed an ugly bug in
lunit.assert()
! Testcases forlunit.assert()
added. - Now all assert functions return the actual value on success.
- First public release!
Send email to: [email protected]