Module:Testunit

local p = {}

function p.main(frame) local args = frame:getParent.args local title = mw.title.getCurrentTitle local typ = args[1] if typ == 'scrib' or typ == 'unittest' then local m = require('Module:' .. (args.modulename or title.rootText) .. '/testcases') if typ == 'scrib' then frame.args = {} m.run(frame) else frame.args = {differs_at = args.differs_at or 1} m.run_tests(frame) end else local testHarness = require('Module:Testharness') if typ == 'sandbox' then frame.args = { modulename = args.modulename or (title.rootText .. '/sandbox'), testdata = args.testdata or (title.rootText .. '/sandbox/testcases'), differs_at = args.differs_at or 1 }       else frame.args = { modulename = args.modulename or '', testdata = args.testdata or '', differs_at = args.differs_at or 1 }       end testHarness.run_tests(frame) end end

return p