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
It seems one function can be one case, so if I create a anonymous function for each entry in the test table, will luaunit treat them separately as different cases?
Sorry, I'm a Lua newbie, can't implement the feature now.
locallu=require"luaunit.luaunit"-- data for testcaseslocaltestcases=
{
{a=1,b=1},
{a=2,b=4},
{a=3,b=9},
}
-- function to test one testcaselocalfunctiontest_testcase(testcase)
locala,b=testcase.a,testcase.blu.assertEquals(b,a*a)
end-- create luaunit compliant testTestTestcases={}
fori,testcaseinipairs(testcases) doTestTestcases["Test_"..i]=function()test_testcase(testcase)endend-- run testos.exit( lu.LuaUnit.run() )
Hi, I'm using table driven tests, where all input and expected result are in a table.
However, in luaunit, it's a single case, not one case per entry in the table (like golang).
Is there a way to run the table as one case per entry?
Thanks
The text was updated successfully, but these errors were encountered: