1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00
RedMew/utils/test/assert.lua

20 lines
382 B
Lua
Raw Normal View History

2020-09-19 13:41:24 +02:00
local error = error
local concat = table.concat
local Public = {}
function Public.equal(a, b, optional_message)
if a == b then
return
end
local message = concat {tostring(a), ' ~= ', tostring(b)}
if optional_message then
message[message + 1] = ' - '
message[message + 1] = optional_message
end
error(message, 2)
end
return Public