Commit b7b1a9a2 authored by François Perrad's avatar François Perrad
Browse files

more assert

parent 673c7869
Pipeline #433184 passed with stages
in 14 seconds
......@@ -53,13 +53,15 @@ local lua = _retrieve_progname()
plan'no_plan'
do -- assert
local v, msg = assert('text', "assert string")
local v, msg, extra = assert('text', "assert string", 'extra')
equals(v, 'text', "function assert")
equals(msg, "assert string")
v, msg = assert({}, "assert table")
equals(extra, 'extra')
v, msg, extra = assert({}, "assert table", 'extra')
equals(msg, "assert table")
equals(extra, 'extra')
error_matches(function () assert(false, "ASSERTION TEST") end,
error_matches(function () assert(false, "ASSERTION TEST", 'extra') end,
"^[^:]+:%d+: ASSERTION TEST",
"function assert(false, msg)")
......@@ -73,7 +75,7 @@ do -- assert
else
error_matches(function () assert(false, 42) end,
"^[^:]+:%d+: 42",
"function assert(false, 42)")
"function assert(false, 42) --> invalid")
end
if has_error53 then
......
Markdown is supported
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