Jump to content

Module:Multiple releases/testcases

From Wikipedia, the free encyclopedia
-- Unit tests for [[Module:Module:Multiple releases]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_01_software_with_reference()
	self:preprocess_equals_many('{{#invoke:Multiple releases/sandbox|main|', '}}', {
		{'software=Q71483|version_type=stable|platforms=android,ios,macos,windows,web,linux', ''},
		{'software=Q71483|version_type=pre_release|platforms=android,ios,macos,windows,web,linux', ''},
		{'software=Q71483|version_type=stable', ''},
		{'software=Q71483|version_type=pre_release', ''},
	})
end

function p:test_02_software_no_reference()
	self:preprocess_equals_many('{{#invoke:Multiple releases/sandbox|main|', '}}', {
		{'software=Q50077|version_type=stable|platforms=android,ios,macos,windows,web,linux', ''},
		{'software=Q50077|version_type=pre_release|platforms=android,ios,macos,windows,web,linux', ''},
		{'software=Q50077|version_type=stable', ''},
		{'software=Q50077|version_type=pre_release', ''},		
	})
end

function p:test_03_language_with_reference()
	self:preprocess_equals_many('{{#invoke:Multiple releases/sandbox|main|', '}}', {
		{'software=Q28865|version_type=stable', ''},
		{'software=Q28865|version_type=pre_release', ''},
	})
end

function p:test_04_language_no_reference_no_version_type()
	self:preprocess_equals_many('{{#invoke:Multiple releases/sandbox|main|', '}}', {
		{'software=Q234657|version_type=stable', ''},
		{'software=Q234657|version_type=pre_release', ''},
	})
end

return p