Skip to content

EvandroLG/simple_test

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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(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
@evandrolg

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published