An open API service indexing awesome lists of open source software.

https://github.com/moritree/lua-tinyt

A tiny unit testing library for Lua.
https://github.com/moritree/lua-tinyt

lua unit-testing

Last synced: 21 days ago
JSON representation

A tiny unit testing library for Lua.

Awesome Lists containing this project

README

          

A short, sweet, simple unit test framework for Lua. Refer to `example.lua` for usage.

# Creating a test suite
Import the test script.

```Lua
local test = require('lunit').create()
```

Register tests with `test:test(name, fn)`. Write your test code in `fn`, and use `test:expect()` statements to make your assertions.

```Lua
test:test("True is true", function()
test:expect(true).is_true()
end)

test:test("Basic maths is real", function()
test:expect(2 + 2).to_eq(4)
)
```

Run your registered tests.

```Lua
test:run()
```