Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Core
(view source)
Revision as of 03:19, 24 March 2017
251 bytes added
,
7 years ago
no edit summary
Line 128:
Line 128:
function Utils.requireModule(name)
function Utils.requireModule(name)
return pcall(function () return require(string.format("Module:%s", name)) end)
return pcall(function () return require(string.format("Module:%s", name)) end)
+
end
+
+
function Utils.registerFormatTests(obj, tests, fn)
+
obj.run_format_tests = function()
+
for _, test in ipairs(tests) do
+
local result = obj.format(nil, test)
+
mw.log(fn and fn(result) or result)
+
end
+
end
end
end
return Utils
return Utils
がか
cssedit, gkautomate
7,064
edits