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: a25e8d67ffb10555

Jump to content

Module:Deprecated archive/sandbox/testcases

From Wikipedia, the free encyclopedia
local p = require('Module:UnitTests')
local sandbox = require('Module:Deprecated archive/sandbox')

local marker = '<sup>&#91;[[WP:ATODAY|link removed]]&#93;</sup>'

local function expected_label(label)
	return '<span style="text-decoration: underline dashed #ccc;">' ..
		label ..
		'</span>' .. marker
end

local function without_tracking_category(text)
	return (text:gsub('%[%[Category:[^%]]+%]%]$', ''))
end

function p:test_html_entities_render_normally()
	local nbsp = mw.ustring.char(160)

	self:equals(
		'&nbsp; decodes to a non-breaking space',
		without_tracking_category(sandbox._main({
			url = 'https://blacklisted.example.com/20120721063948/http://usps.whitepages.com/service/post_office/67234?p=1&s=NY&service_name=post_office&z=10001',
			title = 'Post Office Location&nbsp;– James A. Farley',
		})),
		expected_label('Post Office Location' .. nbsp .. '– James A. Farley'),
		{nowiki = true}
	)

	self:equals(
		'&nbsp; inside a title decodes to a non-breaking space',
		without_tracking_category(sandbox._main({
			url = 'https://blacklisted.example.com/20110310083111/http://www3.interscience.wiley.com/journal/122575093/abstract',
			title = 'Inkjet Printing&nbsp;– Process and Its Applications',
		})),
		expected_label('Inkjet Printing' .. nbsp .. '– Process and Its Applications'),
		{nowiki = true}
	)

	self:equals(
		'&ndash; decodes to an en dash',
		without_tracking_category(sandbox._main({
			url = 'https://blacklisted.example.com/20150420042022/http://factfinder.census.gov/bkmk/table/1.0/en/DEC/10_SF1/GCTPH1.CY10/0500000US34037',
			title = 'GCT-PH1: Population, Housing Units, Area, and Density: 2010 - County &ndash; County Subdivision and Place from the 2010 Census Summary File 1 for Burlington County, New Jersey',
		})),
		expected_label('GCT-PH1: Population, Housing Units, Area, and Density: 2010 - County – County Subdivision and Place from the 2010 Census Summary File 1 for Burlington County, New Jersey'),
		{nowiki = true}
	)
end

function p:test_non_entity_special_title_cases_match_production()
	self:preprocess_equals_preprocess_many('{{#invoke:Deprecated archive/sandbox|main', '}}', '{{#invoke:Deprecated archive|main', '}}', {
		-- page=Brown_University el_id=1074318404
		{[=[
 |url=https://blacklisted.example.com/20120713173534/http://investing.businessweek.com/research/stocks/people/person.asp?personId=534990&ticker=EXPE:US
 |title=Dara Khosrowshahi: Executive Profile & Biography
]=]},
		-- page=German_cuisine el_id=1062049711
		{[=[
 |url=https://blacklisted.example.com/20080307163116/http://www.foodfromgermany.org/consumer/facts/guidetosausages.cfm
 |title=Guide to German Sausages & Meat Products
]=]},
		-- page=Alps el_id=834720466
		{[=[
 |url=https://blacklisted.example.com/20130415150259/http://litthe.oxfordjournals.org/content/24/1/4.full
 |title=Gods, Ghosts, and Shelley's 'Atheos'
]=]},
		-- page=Abu_Zubaydah el_id=451902940
		{[=[
 |url=https://blacklisted.example.com/20130415182026/http://www.pubrecord.org/torture/701-doj-report-blasts-yoo-for-not-citing-court-case-in-torture-memo.html
 |title=Jason Leopold "DOJ Report Says Yoo's Torture Memo Failed To Cite Supreme Court Case"
]=]},
		-- page=Economy_of_Armenia el_id=1007628662
		{[=[
 |url=https://blacklisted.example.com/20130117025908/http://www.armenianow.com/?action=viewArticle&AID=3382&CID=3245&IID=1209&lng=eng
 |title=''Price Predictions: With present inflation at nearly triple expectation, economists challenge 2009 forecast''
]=]},
		-- page=Bauhaus el_id=1117649538
		{[=[
 |url=https://blacklisted.example.com/20050503051137/http://www.cultinfo.ru/fulltext/1/001/008/007/304.htm
 |title=''Вхутемас''
]=]},
		-- page=Ainu_people el_id=565795001
		{[=[
 |url=https://blacklisted.example.com/20070530090801/http://www.city.kitami.lg.jp/650-03/100/nupunkesi100.htm
 |title=市史編さんニュース №100 ヌプンケシ
]=]},
		-- page=Amphipolis el_id=673637529
		{[=[
 |url=https://blacklisted.example.com/20120604182322/http://cefael.efa.gr/detail.php?site_id=1&actionID=page&prevpos=0&serie_id=BCH&volume_number=59&issue_number=0&startpos=289
 |title=Bulletin de Correspondance Hellénique
]=]},
		-- page=David_Thompson_(explorer) el_id=522100538
		{[=[
 |url=https://blacklisted.example.com/20130101104245/http://link.library.utoronto.ca/champlain/item_record.cfm?Idno=9_96867&lang=eng&query=9_96867&searchtype=Bibrecord&startrow=1&Limit=All
 |title=David Thompson's narrative, 1784–1812
]=]},
		-- page=Foreign_relations_of_Hungary el_id=713603154
		{[=[
 |url=https://blacklisted.example.com/20081202140936/http://www.kln.gov.my/mission/budapest
 |title=Hungary–Malaysia relations on www.kln.gov.my
]=]},
		-- page=Spin_glass el_id=758847042
		{[=[
 |url=https://blacklisted.example.com/20130415143828/http://papercore.org/Sherrington1975
 |title=Papercore Summary http://papercore.org/Sherrington1975
]=]},
		-- page=Natacha_Atlas el_id=1095505552
		{[=[
 |url=https://blacklisted.example.com/20120912172649/http://www.thenational.ae/article/20080910/ART/557586592/1007/REVIEW
 |title=Ana Hina – Natacha Atlas & The Mazeeka Ensemble (World Village)
]=]},
	} )
end

return p