Module:Depicted people/testcases

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Lua
CodeDiscussionEditHistoryLinksLink count Subpages:DocumentationTestsResultsSandboxLive code All modules

Documentation for this module may be created at Module:Depicted people/testcases/doc

Code

-- Unit tests for [[Module:Depicted people]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_1_en()
	self:preprocess_equals('{{#invoke:Depicted people|main|one guy|lang=en}}', 'one guy')
end

function p:test_1_wikidata_it()
	self:preprocess_equals('{{#invoke:Depicted people|main|Q7439|lang=it}}', '[[w:it:Richard Stallman|Richard Stallman]]')
end

function p:test_2_en()
	self:preprocess_equals('{{#invoke:Depicted people|main|one guy|his brother|lang=en}}', 'one guy and his brother')
end

function p:test_2_it()
	self:preprocess_equals('{{#invoke:Depicted people|main|un tizio|suo fratello|lang=it}}', 'un tizio e suo fratello')
end

function p:test_3_wikidata_en()
	self:preprocess_equals('{{#invoke:Depicted people|main|one guy|his brother|Q7439|lang=en}}', 'one guy, his brother and [[w:en:Richard Stallman|Richard Stallman]]')
end

function p:test_3_wikidata_it()
	self:preprocess_equals('{{#invoke:Depicted people|main|un tizio|suo fratello|Q7439|lang=it}}', 'un tizio, suo fratello e [[w:it:Richard Stallman|Richard Stallman]]')
end

return p