Module:Sandbox/Innesw/PopulationFromWikidata-upgrade/testcases
| This is the test cases page for the module Module:Sandbox/Innesw/PopulationFromWikidata-upgrade. Results of the test cases. |
-- Test cases for comparison of the current and proposed upgrade (in the sandbox) versions of Module:PopulationFromWikidata.
-- The output from this page is shown at Module_talk:PopulationFromWikidata/testcases
-- UnitTests is a system for testing modules.
local p = require("module:UnitTests")
function p:test1()
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox}}',
'',
{noexpectation=1}
)
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q2821571}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q2821571}}',
'',
{noexpectation=1}
)
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q11568|type=city}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q11568|type=city}}',
'',
{noexpectation=1}
)
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q2821571|type=town}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q2821571|type=town}}',
'',
{noexpectation=1}
)
--[=[ type=locality not yet approved for release
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q2821571|type=locality}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q2821571|type=locality}}',
'',
{noexpectation=1}
)
]=]
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q1027823|type=suburb}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q1027823|type=suburb}}',
'',
{noexpectation=1}
)
--[=[ type=settlement not yet approved for release
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q6896123|type=settlement}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q6896123|type=settlement}}',
'',
{noexpectation=1}
)
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q5174266|type=settlement}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q5174266|type=settlement}}',
'',
{noexpectation=1}
)
]=]
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q649969|type=region}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q649969|type=region}}',
'',
{noexpectation=1}
)
end
function p:testCheck_Only__References_Suppressed()
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q2821571|check=yes}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q2821571|check=yes}}',
'',
{noexpectation=1}
)
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q2821571|type=suburb|check=yes}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q2821571|type=suburb|check=yes}}',
'',
{noexpectation=1}
)
end
function p:testGeography_Specified()
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q5174266|type=settlement|geog=sal}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q5174266|type=settlement|geog=sal}}',
'',
{noexpectation=1}
)
end
function p:testMerged_Claims()
self:preprocess_equals_compare(
'{{#invoke:PopulationFromWikidata|ListForInfobox|wikidata=Q4856763|type=town}}',
'{{#invoke:Sandbox/Innesw/PopulationFromWikidata-upgrade|ListForInfobox|wikidata=Q4856763|type=town}}',
'',
{noexpectation=1}
)
end
return p
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.