Jump to content

Module:Link with country/testcases: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Line 6: Line 6:
self:preprocess_equals('{{#invoke:Link with country | countrynames |United States of America| property=P495 }}', 'United States')
self:preprocess_equals('{{#invoke:Link with country | countrynames |United States of America| property=P495 }}', 'United States')
self:preprocess_equals('{{#invoke:Link with country | countrynames |Peoples Republic of China, Nazi Germany| property=P495 }}', 'China, Nazi Germany')
self:preprocess_equals('{{#invoke:Link with country | countrynames |Peoples Republic of China, Nazi Germany| property=P495 }}', 'China, Nazi Germany')
self:preprocess_equals('{{#invoke:Link with country | countrynames |XxxXXxX| property=P495 }}', 'XxxXXxX')

end
end



Revision as of 00:09, 20 May 2024

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

-- Example unit test.
function p:test_countrynames()
	self:preprocess_equals('{{#invoke:Link with country | countrynames |United States of America| property=P495 }}', 'United States')
	self:preprocess_equals('{{#invoke:Link with country | countrynames |Peoples Republic of China, Nazi Germany| property=P495 }}', 'China, Nazi Germany')
	self:preprocess_equals('{{#invoke:Link with country | countrynames |XxxXXxX| property=P495 }}', 'XxxXXxX')
end

return p