dead simple test suite for luau
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| LICENSE | Initial commit | |
| README.md | Update README.md | |
| suite.luau | type error go brrrr | |
suite
Dead simple test suite for Luau.
Usage
local test = require("./suite")
local suite = test.new()
test.group(suite, "math", function()
test.equal(suite, "addition", 1 + 1, 2)
test.gt(suite, "pi", math.pi, 3)
test.near(suite, "sqrt2", math.sqrt(2), 1.41421, 0.001)
end)
test.group(suite, "strings", function()
test.equal(suite, "length", #"hello", 5)
test.not_equal(suite, "different", "a", "b")
test.truthy(suite, "non-empty", #"x" > 0)
end)
test.group(suite, "errors", function()
test.fails(suite, "index nil", function()
local t: any = nil
local _ = t.x
end)
end)
test.finish(suite)
output:
PASS math (3)
PASS strings (3)
PASS errors (1)
7/7 passed, 3 groups (0.001s)