Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local test groups and their order of execution. #164

Open
DKnoto opened this issue Sep 12, 2024 · 0 comments
Open

Local test groups and their order of execution. #164

DKnoto opened this issue Sep 12, 2024 · 0 comments

Comments

@DKnoto
Copy link

DKnoto commented Sep 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant