diff --git a/test/library/structures.lua b/test/library/structures.lua index 241000a69..5c9f41561 100644 --- a/test/library/structures.lua +++ b/test/library/structures.lua @@ -18,7 +18,7 @@ function test.overlappingGlobals() local prev = globals[i - 1] local cur = globals[i] - expect.true_(prev.last < cur.first, "global variable " .. prev.name .. " overlaps global variable " .. cur.name) + expect.lt(prev.last, cur.first, "global variable " .. prev.name .. " overlaps global variable " .. cur.name) end end diff --git a/test/main.lua b/test/main.lua index 53e71701a..6dfed1d92 100644 --- a/test/main.lua +++ b/test/main.lua @@ -27,6 +27,18 @@ end function expect.ne(a, b, comment) return a ~= b, comment, ('%s == %s'):format(a, b) end +function expect.lt(a, b, comment) + return a < b, comment, ('%s >= %s'):format(a, b) +end +function expect.le(a, b, comment) + return a <= b, comment, ('%s > %s'):format(a, b) +end +function expect.gt(a, b, comment) + return a > b, comment, ('%s <= %s'):format(a, b) +end +function expect.ge(a, b, comment) + return a >= b, comment, ('%s < %s'):format(a, b) +end function expect.table_eq(a, b, comment) local checked = {} for k, v in pairs(a) do