跳转到内容

模組:Effective protection level/testcases

维基百科,自由的百科全书

这是本页的一个历史版本,由Xiplus留言 | 贡献2019年4月18日 (四) 03:25编辑。这可能和当前版本存在着巨大的差异。

-- [[Module:Test]]的單元測試範例,前往討論頁以執行測試。
local p = require('Module:UnitTests')

function p:test_edit()
	self:preprocess_equals_many('{{#invoke:Effective protection level/sandbox|edit|', '}}', {
		{'MediaWiki:Spam-blacklist', 'sysop'},
		{'User:Example/common.js', 'interfaceadmin'},
		{'User:Example/common.css', 'interfaceadmin'},
		{'User:Example/common.json', 'sysop'},
		{'Mediawiki:common.js', 'interfaceadmin'},
		{'Mediawiki:common.css', 'interfaceadmin'},
		{'Mediawiki:common.json', 'sysop'},
		{'Template:Checkuser', 'sysop'},
		{'Template:Y', 'autoconfirmed'},
		{'Template:Pp-jupe', 'sysop'},
		{'User:Liangent-bot/message/ts-ntvc-dup-vfd', 'sysop'},
		{'Module:Sandbox', 'autoconfirmed'},
		{'ClearType', '*'},
	}, {nowiki=1})
end

function p:test_move()
	self:preprocess_equals_many('{{#invoke:Effective protection level/sandbox|move|', '}}', {
		{'MediaWiki:Spam-blacklist', 'sysop'},
		{'User:Example/common.js', 'interfaceadmin'},
		{'User:Example/common.css', 'interfaceadmin'},
		{'User:Example/common.json', 'sysop'},
		{'Mediawiki:common.js', 'interfaceadmin'},
		{'Mediawiki:common.css', 'interfaceadmin'},
		{'Mediawiki:common.json', 'sysop'},
		{'Template:Checkuser', 'sysop'},
		{'Template:Y', 'autoconfirmed'},
		{'Template:Pp-jupe', 'autoconfirmed'},
		{'User:Liangent-bot/message/ts-ntvc-dup-vfd', 'sysop'},
		{'Module:Sandbox', 'autoconfirmed'},
		{'File:HomuWitch_teara.gif', 'filemover'},
		{'ClearType', 'autoconfirmed'},
	})
end

function p:test_upload()
	self:preprocess_equals_many('{{#invoke:Effective protection level/sandbox|upload|', '}}', {
		{'File:QWERTYUIIOOOO.jpg', 'autoconfirmed'},
	})
end

return p