Improved error message for nil table comparison in testing framework

This commit is contained in:
Jason Perkins 2012-10-11 10:59:15 -04:00
parent d27fc9a3a8
commit 279caeac82

View File

@ -99,6 +99,9 @@
function test.isequal(expected, actual)
if type(expected) == "table" then
if expected and not actual then
test.fail("expected table, got nil")
end
if #expected < #actual then
test.fail("expected %d items, got %d", #expected, #actual)
end