• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
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

Navigation menu