You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Static analysis using Luacheck for such a set of tests:
local lu = require "luaunit";
TestFirst = {};
function TestFirst:test_01()
--
end;
TestOther = {};
-- ...
os.exit(lu.LuaUnit.run());
Shows:
FunctionsTest.lua:3:1: setting non-standard global variable TestFirst
FunctionsTest.lua:5:10: mutating non-standard global variable TestFirst
FunctionsTest.lua:5:19: unused argument self
I would expect an alternative approach:
local lu = require "luaunit";
local TestFirst = {};
function TestFirst:test_01()
-- ...
end;
local TestOther = {};
-- ...
os.exit(lu.LuaUnit.run({TestFirst, TestOther}));
This approach will not generate these warnings, making it easier to analyze the content of the test, and it would also make it easier to determine the order of tests at the group level.
The text was updated successfully, but these errors were encountered:
Static analysis using Luacheck for such a set of tests:
Shows:
I would expect an alternative approach:
This approach will not generate these warnings, making it easier to analyze the content of the test, and it would also make it easier to determine the order of tests at the group level.
The text was updated successfully, but these errors were encountered: