Edge Rewrite
// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a451c8c8ba27cf77

Jump to content

Module:Sandbox/Innesw/PopulationFromWikidata-upgrade/testcases

From Wikipedia, the free encyclopedia
-- 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