Commit f06b5c42 authored by Carlos Eduardo Lara Augusto's avatar Carlos Eduardo Lara Augusto
Browse files

Lançamento da versão 1.0.1 devido à issue OPENBUS-1411.


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/luautils/latt/tags/v1_00_01_2011_07_12@119908 ae0415b3-e90b-0410-900d-d0be9363c56b
No related merge requests found
Showing with 9 additions and 0 deletions
+9 -0
local unpack = unpack
local error = error
local tostring = tostring
local type = type
local oop = require "loop.base"
......@@ -8,6 +9,12 @@ local latt = latt
module("latt.Check", oop.class)
local function assertBoolean(condition)
if type(condition) ~= "boolean" then
error("The condition is not a boolean value.", 3)
end
end
function assertError(f, ...)
local success = latt.pcall(f, unpack(arg))
if success then
......@@ -28,12 +35,14 @@ function assertNotEquals(expected, actual)
end
function assertTrue(condition)
assertBoolean(condition)
if condition == false then
error("The condition must be true.", 2)
end
end
function assertFalse(condition)
assertBoolean(condition)
if condition == true then
error("The condition must be false.", 2)
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment