Module:Template test case: Difference between revisions

Don't export the table and nowiki functions. At the moment the Lua interfaces don't make much sense, and rewriting the module to include nice Lua interfaces would probably be a lot of wasted work, as Lua modules will generally use Lua-based test cases.
(add the option defaults before we compress the table to fix the case where the first numbered argument is higher than 2)
(Don't export the table and nowiki functions. At the moment the Lua interfaces don't make much sense, and rewriting the module to include nice Lua interfaces would probably be a lot of wasted work, as Lua modules will generally use Lua-based test cases.)
Line 474:
 
-------------------------------------------------------------------------------
-- Bridge functions
-- Exports
--
-- These functions translate template arguments into forms that can be accepted
-- by the different classes, and return the results.
-------------------------------------------------------------------------------
 
local pbridge = {}
 
function pbridge.table(args, cfg)
cfg = cfg or mw.loadData(DATA_MODULE)
 
Line 508 ⟶ 511:
end
 
function pbridge.nowiki(args, cfg)
cfg = cfg or mw.loadData(DATA_MODULE)
 
Line 518 ⟶ 521:
return tostring(testCaseObj)
end
 
-------------------------------------------------------------------------------
-- Exports
-------------------------------------------------------------------------------
 
local p = {}
 
function p.main(frame, cfg)
Line 552 ⟶ 561:
end
 
return pbridge[func](args, cfg)
end