Skip to content

Releases: rjpcomputing/luaunit

v2.1

10 Jun 18:46
Compare
Choose a tag to compare
  • Fix test selection from the command line.
  • Report caller's line number when assertEquals fails for tables.
  • When printing tables, only put quotes around strings.

v2.0

10 Jun 14:10
Compare
Choose a tag to compare
  • This is a major update that has some breaking changes to make it much more easy to use and code in many different styles
  • Made the module only touch the global table for the asserts. You now use the module much more like Lua 5.2 when you require it.
    You need to store the LuaUnit table after you require it to allow you access to the LuaUnit methods and variables.
    (ex. local LuaUnit = require( "luaunit" ))
  • Made changes to the style of which LuaUnit forced users to code there test classes. It now is more layed back and give the ability to code in a few styles.
    • Made "testable" classes able to start with 'test' or 'Test' for their name.
    • Made "testable" methods able to start with 'test' or 'Test' for their name.
    • Made testClass:setUp() methods able to be named with 'setUp' or 'Setup' or 'setup'.
    • Made testClass:tearDown() methods able to be named with 'tearDown' or 'TearDown' or 'teardown'.
    • Made LuaUnit.wrapFunctions() function able to be called with 'wrapFunctions' or 'WrapFunctions' or 'wrap_functions'.
    • Made LuaUnit:run() method able to be called with 'run' or 'Run'.
  • Added the ability to tell if tables are equal using assertEquals. This uses a deep compare, not just the equality that they are the same memory address.
  • Added LuaUnit.is and LuaUnit.is_ helper functions. (e.g. assert( LuaUnit.isString( getString() ) )
  • Added assert and assert_
  • Added assertNot and assert_not_
  • Added _VERSION variable to hold the LuaUnit version
  • Added LuaUnit:setVerbosity(lvl) method to the LuaUnit table to allow you to control the verbosity now. If lvl is greater than 1 it will give verbose output.
    This can be called from alias of LuaUnit.SetVerbosity() and LuaUnit:set_verbosity().
  • Moved wrapFunctions to the LuaUnit module table (e.g. local LuaUnit = require( "luaunit" ); LuaUnit.wrapFunctions( ... ) )
  • Fixed the verbosity to actually format in a way that is closer to other unit testing frameworks I have used.
    NOTE: This is not the only way, I just thought the old output was way to verbose and duplicated the errors.
  • Made the errors only show in the "test report" section (at the end of the run)