Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// 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: a21d80c1591b4c41

Jump to content

Module:PopulationFromWikidata/testcases

From Wikipedia, the free encyclopedia
--Test cases for the sandbox version of the PopulationFromWikidata module. This is a Lua module for testing the sandbox module.

-- we inherit p from another module
-- UnitTests is a system of testing modules. We'll expose the outputs of tests. 
-- We want to specify the expected output to compare to the actual. But for now we're not using this comparison, we're just checking the output manually.
local p = require("module:UnitTests")
function p:test1()
	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox}}', '')
--	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q2821571}}', '', {nowiki=1})
--	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q2821571}}', '<div>\n* 2,051 (Suburbs and Localities 2021)<ref></ref></div>[[Category:Australian place articles using Wikidata population values]]')
	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q2821571}}', '', {noexpectation=1})
	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q2821571|type = suburb}}', '', {noexpectation=1})
	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q2821571|type = Suburb}}', '', {noexpectation=1})
	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q2821571|type = town}}', '', {noexpectation=1})
	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q649969|type = region}}', '', {noexpectation=1})
	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q11568|type = city}}', '', {noexpectation=1})
	self:preprocess_equals('{{#invoke:PopulationFromWikidata/sandbox|ListForInfobox|wikidata=Q5174266|type = town}}', '', {noexpectation=1})
	
end


return p