Content deleted Content added
rmv old/test/unneeded code |
that's cool |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1:
if mw.title.getCurrentTitle().prefixedText == "Module:Sandbox/Aidan9382" then
require('Module:Module wikitext')._addText('{{User:Aidan9382/sandbox/header|nolint=y}}')
end▼
require("strict")
local p = {}
Line 7 ⟶ 9:
end
function p.Debug(arg1, arg2) -- General-purpose debugger/testing tool; combines multiple submodules
function p.parentingLogic(frame)▼
-- Runs CodeAnalysis and Benchmarker
-- Benchmarker expects either p and the module name or the return function and the module name
local parentChain = {}▼
-- This is to be required in the module, not `#invoke:`ed
require('Module:Module wikitext')._addText('{{#invoke:Sandbox/Aidan9382/CodeAnalysis|main}}')
local Hook = require("Module:Sandbox/Aidan9382/Benchmarker")
local t = type(arg1) == "table" and arg1 or type(arg1) == "nil" and {} or nil
return Hook(t, arg2 or "root module")
return Hook(arg1, arg2 or "root module")
elseif arg1 ~= false then
end▼
mw.log("Aidan9382 | Unable to load Benchmarker (unexpected arg setup)")
▲end
p["module-use"] = function(frame)▼
▲ if c then
end▼
end
end
Line 97 ⟶ 80:
else
return "{{DEFAULTSORT:XYZ}}"
end▼
▲ elseif args.returnprocess == "y" then
end
end
Line 118 ⟶ 90:
function p.SpeedTest(frame)
local text = mw.text.unstripNoWiki(frame.args[1])
local
local start = os.clock()
for i = 1, tonumber(frame.args[2]) or 10
local r = tostring(math.random())
▲ end
local duration = os.clock() - start
return "Time taken: " .. duration .. "\n\n" .. table.concat(outs, frame.args[3] or "\n")
local text = mw.text.unstripNoWiki(frame.args[1])
local start = os.clock()
for i = 1, tonumber(frame.args[2]) or 10 do
outs[#outs+1] = frame:preprocess(text)
end
local duration = os.clock() - start
return out▼
return "Time taken: " .. duration .. "\n\n" .. table.concat(outs, frame.args[3] or "\n")
end
Line 137 ⟶ 122:
while os.clock()-start < t do end
return "Wasted " .. (os.clock()-start) .. " seconds"
mw.incrementExpensiveFunctionCount()
end
|