...
1# simple_test
2A powerful, minimalist and easy-to-use Lua unit testing framework.
3
4[](https://travis-ci.org/EvandroLG/simple_test)
6
7## Installation
8To install `simple_test`, simply run:
9```sh
10$ luarocks install simple_test
11```
12
13Or copy the `simple_test.lua` file and paste in your project :)
14
15## Getting started
16A minimal test setup:
17
18```lua
19local test = require 'simple_test'
20
21test('assert.equal', function(a)
22 a.ok(1 == 1, 'passed!')
23end)
24```
25
26## asserts
27* assert.<code>ok(test, [failure_message])</code><br>
28Checks if `test` is true.
29
30* assert.<code>not_ok(test, [failure_message])</code><br>
31Checks if `test` is false.
32
33* assert.<code>equal(actual, expected, [failure_message])</code><br>
34Tests if `actual` is equal `expected`.
35
36* assert.<code>not_equal(actual, expected, [failure_message])</code><br>
37Checks if `actual` is not equal `expected`.
38
39* assert.<code>throw(function, params, [raised_message], [failure_message])</code><br>
40Checks if a `function` throws an exception and optionally compare the throw error.
41
42* assert.<code>delta(actual_float, expected_float, [delta], [failure_message])</code><br>
43Checks if `actual_float` and `expected_float` are equal within optional `delta` tolerance
44
45* assert.<code>deep_equal(actual, expected, [failure_message])</code><br>
46Tests for deep equality between the `actual` and `expected` parameters.
47
48## Author
49|[](https://github.com/evandrolg)|
50|:---:|
51|[@evandrolg](http://www.github.com/evandrolg)|
View as plain text