Improved error message for nil table comparison in testing framework
This commit is contained in:
parent
d27fc9a3a8
commit
279caeac82
@ -99,6 +99,9 @@
|
|||||||
|
|
||||||
function test.isequal(expected, actual)
|
function test.isequal(expected, actual)
|
||||||
if type(expected) == "table" then
|
if type(expected) == "table" then
|
||||||
|
if expected and not actual then
|
||||||
|
test.fail("expected table, got nil")
|
||||||
|
end
|
||||||
if #expected < #actual then
|
if #expected < #actual then
|
||||||
test.fail("expected %d items, got %d", #expected, #actual)
|
test.fail("expected %d items, got %d", #expected, #actual)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user