Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evandrolg/simple_test
:ok_hand: A powerful, minimalist and easy-to-use Lua unit testing framework.
https://github.com/evandrolg/simple_test
lua testing
Last synced: about 2 months ago
JSON representation
:ok_hand: A powerful, minimalist and easy-to-use Lua unit testing framework.
- Host: GitHub
- URL: https://github.com/evandrolg/simple_test
- Owner: EvandroLG
- License: mit
- Created: 2017-06-16T03:22:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-22T20:51:15.000Z (about 1 year ago)
- Last Synced: 2023-12-22T21:32:28.313Z (about 1 year ago)
- Topics: lua, testing
- Language: Lua
- Homepage:
- Size: 37.1 KB
- Stars: 20
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple_test
A powerful, minimalist and easy-to-use Lua unit testing framework.[![Build
Status](https://travis-ci.org/EvandroLG/simple_test.svg?branch=master)](https://travis-ci.org/EvandroLG/simple_test)## Installation
To install `simple_test`, simply run:
```sh
$ luarocks install simple_test
```Or copy the `simple_test.lua` file and paste in your project :)
## Getting started
A minimal test setup:```lua
local test = require 'simple_test'test('assert.equal', function(a)
a.ok(1 == 1, 'passed!')
end)
```## asserts
* assert.ok(test, [failure_message])
Checks if `test` is true.* assert.
not_ok(test, [failure_message])
Checks if `test` is false.* assert.
equal(actual, expected, [failure_message])
Tests if `actual` is equal `expected`.* assert.
not_equal(actual, expected, [failure_message])
Checks if `actual` is not equal `expected`.* assert.
throw(function, params, [raised_message], [failure_message])
Checks if a `function` throws an exception and optionally compare the throw error.* assert.
delta(actual_float, expected_float, [delta], [failure_message])
Checks if `actual_float` and `expected_float` are equal within optional `delta` tolerance* assert.
deep_equal(actual, expected, [failure_message])
Tests for deep equality between the `actual` and `expected` parameters.## Author
|[![@evandrolg](https://avatars3.githubusercontent.com/u/444054?v=3&s=96)](https://github.com/evandrolg)|
|:---:|
|[@evandrolg](http://www.github.com/evandrolg)|