Module:Road data/locations/testcases explained

local p =

local live = require('Module:Road data/locations')local sandbox = require('Module:Road data/locations/sandbox')

local function showArgs(frame, args) local out =

for _, arg in ipairs(args) do out = out .. frame:preprocess('' .. mw.dumpObject(arg) .. '') end return outend

local function addTest(frame, out, functionName, ...) out = out .. '|-\n' out = out .. '| style="vertical-align:top" | ' .. functionName .. ' with arguments:' .. showArgs(frame, arg) .. '\n' out = out .. frame:preprocess('| style="vertical-align:top" | ' .. mw.dumpObject(live[functionName](unpack(arg))) .. '\n') out = out .. frame:preprocess('| style="vertical-align:top" | ' .. mw.dumpObject(sandbox[functionName](unpack(arg))) .. '\n')

return outend

function p.test(frame) local out = '

Lua\n' out = out .. '! Live\n' out = out .. 'Sandbox\n' out = addTest(frame, out, 'locations', , 'jctint' ) out = addTest(frame, out, 'locations', , 'jcttop' ) return out .. '
\n'end

return p