Module:Peter Bowman/cache test

There are no reviewed versions of this page, so it may not have been checked for adherence to standards.

Documentation for this module may be created at Module:Peter Bowman/cache test/doc

local p = {}

function p.main(frame)
	local arg = frame.args[1] or 'null'
	global_arg = package.loaded[arg] or arg
	package.loaded[arg] = global_arg
	return 'local: ' .. arg .. ', global: ' .. global_arg
end

function p.test(frame)
	local op = frame.args[1]
	
	if op == '1' then
		error('test: [[User:Peter Bowman]]', 1)
	elseif op == '2' then
		error('test: [[User:Peter Bowman]]', 2)
	elseif op == '3' then
		error('test: [[User:Peter Bowman]]', 0)
	end
end

return p