Jump to content

Module:T122752test

From Wikipedia

Documentation for this module may be created at Module:T122752test/doc

-- Module:T122752test
-- See https://phabricator.wikimedia.org/T122752
-- {{phab:T122752}} #invoke seems do not record the module
-- Call page: {{#invoke:T122752test|test}}

local p = {}

local T122752_result = "About [[phab:T122752]] #invoke seems do not record the module " -- run at require() time
T122752_result = T122752_result .. '\n* require( "Module:T122752test" ) fine record the module' -- run at require() time

function p.test(frame)
	local res = T122752_result
	local recorded_at_invoke_time = false
	for title, module in pairs(package.loaded) do -- List package.loaded modules
		if string.find(title, "T122752") then recorded_at_invoke_time = true end
	end
	if recorded_at_invoke_time -- run at invoke time
	then res = res .. "\n* And {{#invoke:T122752test | test }} <b>fine records the module<b>."
	else res = res .. "\n* But {{#invoke:T122752test | test }} <b>do not record the module in package.loaded</b>:." end
	return res
end

return p