👌 A powerful, minimalist and easy-to-use Lua unit testing framework.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
LICENCE
README.md
simple_test-0.0.5-0.rockspec
simple_test.lua
test.lua

README.md

simple_test

A powerful, minimalist and easy-to-use Lua unit testing framework.

Build Status

Installation

To install simple_test, simply run:

$ luarocks install simple_test

Or copy the simple_test.lua file and paste in your project :)

Getting started

A minimal test setup:

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(expected, actual, [failure_message])
    Checks if expected is equal actual.

  • assert.not_equal(expected, actual, [failure_message])
    Checks if expected is not equal actual.

  • assert.throw(function, params, [raised_message], [failure_message])
    Checks if a function throws an exception and optionally compare the throw error.

  • assert.delta(expected_float, actual_float, [delta], [failure_message])
    Checks if expected_float and actual_float are equal within optional detlta tolerance

Author

@evandrolg
@evandrolg