<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ACommons_link%2Fsandbox%2Ftestcases</id>
	<title>Module:Commons link/sandbox/testcases - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ACommons_link%2Fsandbox%2Ftestcases"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Commons_link/sandbox/testcases&amp;action=history"/>
	<updated>2026-04-09T03:49:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Commons_link/sandbox/testcases&amp;diff=135726&amp;oldid=prev</id>
		<title>imported&gt;Hike395: fix broken tests</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Commons_link/sandbox/testcases&amp;diff=135726&amp;oldid=prev"/>
		<updated>2021-12-04T06:14:54Z</updated>

		<summary type="html">&lt;p&gt;fix broken tests&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = require(&amp;#039;Module:UnitTests&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p:testGallery()&lt;br /&gt;
	-- known link&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | Mount Whitney}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Mount Whitney|Mount Whitney]]&amp;#039;)&lt;br /&gt;
	-- known link with linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | Mount Whitney |linktext=Big Mountain}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Mount Whitney|Big Mountain]]&amp;#039;)&lt;br /&gt;
	-- forced search&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | search=Mount Whitney}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Mount Whitney|Mount Whitney]]&amp;#039;)&lt;br /&gt;
	-- forced search + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | search=Mount Whitney |linktext=Big Mountain}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Mount Whitney|Big Mountain]]&amp;#039;)&lt;br /&gt;
	-- P935 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q2217963}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Samuel Baker House|Samuel Baker House]]&amp;#039;)&lt;br /&gt;
	-- P935 matches sitelink + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q2217963 |linktext=Big House}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Samuel Baker House|Big House]]&amp;#039;)&lt;br /&gt;
	-- sitelink only, lcfirst&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q816044 | lcfirst=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Bellows Falls, Vermont|bellows Falls, Vermont]]&amp;#039;)&lt;br /&gt;
	-- sitelink only, bold&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q816044 | bold=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Bellows Falls, Vermont|&amp;lt;span style=&amp;quot;font-weight:bold;&amp;quot;&amp;gt;Bellows Falls, Vermont&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- sitelink only, italic&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q816044 | italic=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Bellows Falls, Vermont|&amp;lt;span style=&amp;quot;font-style:italic;&amp;quot;&amp;gt;Bellows Falls, Vermont&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- sitelink only, nowrap&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q816044 | nowrap=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Bellows Falls, Vermont|&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;Bellows Falls, Vermont&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- sitelink + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q816044|linktext=Little Town}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Bellows Falls, Vermont|Little Town]]&amp;#039;)&lt;br /&gt;
	-- sitelink and P935 inconsistent&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q139289}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Boeing 737 MAX|Boeing 737 MAX]]&amp;#039;)&lt;br /&gt;
	-- sitelink and P935 inconsistent + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q139289|linktext=Not a plane}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Boeing 737 MAX|Not a plane]]&amp;#039;)&lt;br /&gt;
	-- no sitelink or P935&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q29017978}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Bell FCX-001|Bell FCX-001]]&amp;#039;)&lt;br /&gt;
	-- no sitelink or P935, but linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGallery | qid=Q29017978|linktext=Medium Helicopter}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Bell FCX-001|Medium Helicopter]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:testCategory()&lt;br /&gt;
	-- known link&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | Mount Whitney}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Mount Whitney|Mount Whitney]]&amp;#039;)&lt;br /&gt;
	-- known link with linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | Mount Whitney |linktext=Big Mountain}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Mount Whitney|Big Mountain]]&amp;#039;)&lt;br /&gt;
	-- forced search&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | search=Mount Whitney}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Category:Mount Whitney|Mount Whitney]]&amp;#039;)&lt;br /&gt;
	-- forced search + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | search=Mount Whitney |linktext=Big Mountain}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Category:Mount Whitney|Big Mountain]]&amp;#039;)&lt;br /&gt;
	-- P373 matches sitelink + lcfirst&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2601154|lcfirst=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Agama lionotus|agama lionotus]]&amp;#039;)&lt;br /&gt;
	-- bold&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2601154|bold=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Agama lionotus|&amp;lt;span style=&amp;quot;font-weight:bold;&amp;quot;&amp;gt;Agama lionotus&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- italic&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2601154|italic=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Agama lionotus|&amp;lt;span style=&amp;quot;font-style:italic;&amp;quot;&amp;gt;Agama lionotus&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- nowrap&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2601154|nowrap=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Agama lionotus|&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;Agama lionotus&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- P373 matches sitelink + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2601154|linktext=Small Lizard|lcfirst=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Agama lionotus|small Lizard]]&amp;#039;)&lt;br /&gt;
	-- P910 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q853037}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Bánhida|Bánhida]]&amp;#039;)&lt;br /&gt;
	-- P910 matches P373 + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q853037|linktext=Old Neighborhood}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Bánhida|Old Neighborhood]]&amp;#039;)&lt;br /&gt;
	-- P1754 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2551907}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Lakes of Turkey|Lakes of Turkey]]&amp;#039;)&lt;br /&gt;
	-- P1754 matches P373 + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2551907|linktext=Turkey Lakes}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Lakes of Turkey|Turkey Lakes]]&amp;#039;)&lt;br /&gt;
	-- inconsistency between P373 and P1754&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q1002229}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Municipality of Vipava|Municipality of Vipava]]&amp;#039;)&lt;br /&gt;
	-- test fallback&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q21032720 |fallback=Boing}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Category:Boing|Boing]]&amp;#039;)&lt;br /&gt;
	-- inconsistency between P373 and P1754 + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q1002229|linktext=Little Town}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Municipality of Vipava|Little Town]]&amp;#039;)&lt;br /&gt;
	-- missing data&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2963317}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Category:Chicago Lawn, Chicago|Chicago Lawn, Chicago]]&amp;#039;)&lt;br /&gt;
	-- missing data + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getCategory | qid=Q2963317|linktext=Big Neighborhood}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Category:Chicago Lawn, Chicago|Big Neighborhood]]&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:testGalleryOrCategory()&lt;br /&gt;
	-- known link&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | Mount Whitney}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Mount Whitney|Mount Whitney]]&amp;#039;)&lt;br /&gt;
	-- known link with linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | Mount Whitney |linktext=Big Mountain}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Mount Whitney|Big Mountain]]&amp;#039;)&lt;br /&gt;
	-- forced search&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | search=Mount Whitney}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Mount Whitney|Mount Whitney]]&amp;#039;)&lt;br /&gt;
	-- forced search + linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | search=Mount Whitney |linktext=Big Mountain}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Mount Whitney|Big Mountain]]&amp;#039;)&lt;br /&gt;
	-- P935 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | qid=Q2217963}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Samuel Baker House|Samuel Baker House]]&amp;#039;)&lt;br /&gt;
	-- sitelink only&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | qid=Q816044}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Bellows Falls, Vermont|Bellows Falls, Vermont]]&amp;#039;)&lt;br /&gt;
	-- inconsistent data, fall back to search&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | qid=Q21032720}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Russian military intervention in the Syrian civil war|Russian military intervention in the Syrian civil war]]&amp;#039;)&lt;br /&gt;
	-- P373 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | qid=Q2601154}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Agama lionotus|Agama lionotus]]&amp;#039;)&lt;br /&gt;
	-- P910 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | qid=Q853037}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Bánhida|Bánhida]]&amp;#039;)&lt;br /&gt;
	-- P1754 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | qid=Q2551907}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Lakes of Turkey|Lakes of Turkey]]&amp;#039;)&lt;br /&gt;
	-- missing gallery, inconsistent category&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | qid=Q1002229}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Municipality of Vipava|Municipality of Vipava]]&amp;#039;)&lt;br /&gt;
	-- test fallback&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | fallback=Boing | qid=Q21032720}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Boing|Boing]]&amp;#039;)&lt;br /&gt;
	-- missing data&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryOrCategory | qid=Q2963317}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Chicago Lawn, Chicago|Chicago Lawn, Chicago]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p:testHasGallery()&lt;br /&gt;
	-- P935 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q2217963}}&amp;#039;,&amp;#039;Samuel Baker House&amp;#039;)&lt;br /&gt;
	-- sitelink only&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q816044}}&amp;#039;,&amp;#039;Bellows Falls, Vermont&amp;#039;)&lt;br /&gt;
	-- sitelink and P935 inconsistent&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q139289}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
	-- no sitelink or P935 or category&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q29017978}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
	-- P373 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q2601154}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
	-- P910 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q853037}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
	-- P1754 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q2551907}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
	-- missing gallery, inconsistent category&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q1002229}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
	-- missing data&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGallery | qid=Q2963317}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p:testHasCategory()&lt;br /&gt;
	-- P935 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasCategory | qid=Q2217963}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
	-- sitelink only&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasCategory | qid=Q816044}}&amp;#039;,&amp;#039;Category:Bellows Falls, Vermont&amp;#039;)&lt;br /&gt;
	-- sitelink and P935 inconsistent, fallback to Category instead&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasCategory | qid=Q139289}}&amp;#039;,&amp;#039;Category:Boeing 737 MAX&amp;#039;)&lt;br /&gt;
	-- P373 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasCategory | qid=Q2601154}}&amp;#039;,&amp;#039;Category:Agama lionotus&amp;#039;)&lt;br /&gt;
	-- P910 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasCategory | qid=Q853037}}&amp;#039;,&amp;#039;Category:Bánhida&amp;#039;)&lt;br /&gt;
	-- P1754 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasCategory | qid=Q2551907}}&amp;#039;,&amp;#039;Category:Lakes of Turkey&amp;#039;)&lt;br /&gt;
	-- missing gallery, inconsistent category&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasCategory | qid=Q1002229}}&amp;#039;,&amp;#039;Category:Municipality of Vipava&amp;#039;)&lt;br /&gt;
	-- missing data&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasCategory | qid=Q2963317}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:testHasGalleryOrCategory()&lt;br /&gt;
	-- P935 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q2217963}}&amp;#039;,&amp;#039;Samuel Baker House&amp;#039;)&lt;br /&gt;
	-- sitelink only&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q816044}}&amp;#039;,&amp;#039;Bellows Falls, Vermont&amp;#039;)&lt;br /&gt;
	-- sitelink and P935 inconsistent&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q139289}}&amp;#039;,&amp;#039;Category:Boeing 737 MAX&amp;#039;)&lt;br /&gt;
	-- P373 matches sitelink&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q2601154}}&amp;#039;,&amp;#039;Category:Agama lionotus&amp;#039;)&lt;br /&gt;
	-- P910 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q853037}}&amp;#039;,&amp;#039;Category:Bánhida&amp;#039;)&lt;br /&gt;
	-- P1754 matches P373&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q2551907}}&amp;#039;,&amp;#039;Category:Lakes of Turkey&amp;#039;)&lt;br /&gt;
	-- missing gallery&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q1002229}}&amp;#039;,&amp;#039;Category:Municipality of Vipava&amp;#039;)&lt;br /&gt;
	-- missing data&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q2963317}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
	-- another test&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q185676}}&amp;#039;,&amp;#039;Category:Fado&amp;#039;)&lt;br /&gt;
	-- inconsistent results, P373 should not be invoked here&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| hasGalleryOrCategory | qid=Q477248}}&amp;#039;,&amp;#039;&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p:testGalleryAndCategory()&lt;br /&gt;
	-- known link&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | Mount Whitney}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Mount Whitney|Mount Whitney]]&amp;#039;)&lt;br /&gt;
	-- known link with linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | Mount Whitney |linktext=Big Mountain | italic=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Mount Whitney|&amp;lt;span style=&amp;quot;font-style:italic;&amp;quot;&amp;gt;Big Mountain&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- known category&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | | Mount Whitney | bold=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Mount Whitney|&amp;lt;span style=&amp;quot;font-weight:bold;&amp;quot;&amp;gt;Mount Whitney&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- known category with categorytext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | | Mount Whitney |linktext=Big Mountain|bold=1|italic=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Mount Whitney|&amp;lt;span style=&amp;quot;font-style:italic; font-weight:bold;&amp;quot;&amp;gt;Big Mountain&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- known link and category&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | Mount Whitney | Mount Whitney}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Mount Whitney|Mount Whitney]] ([[Commons:Category:Mount Whitney|category]])&amp;#039;)&lt;br /&gt;
	-- known link and category with linktext&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | Mount Whitney | Mount Whitney | linktext=Big Mountain|bold=1|italic=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Mount Whitney|&amp;lt;span style=&amp;quot;font-style:italic; font-weight:bold;&amp;quot;&amp;gt;Big Mountain&amp;lt;/span&amp;gt;]] ([[Commons:Category:Mount Whitney|category]])&amp;#039;)&lt;br /&gt;
	-- only gallery exists&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | qid=Q2217963|italic=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Samuel Baker House|&amp;lt;span style=&amp;quot;font-style:italic;&amp;quot;&amp;gt;Samuel Baker House&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- both gallery and category exist&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | qid=Q816044|bold=1|categoryText=cat}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Bellows Falls, Vermont|&amp;lt;span style=&amp;quot;font-weight:bold;&amp;quot;&amp;gt;Bellows Falls, Vermont&amp;lt;/span&amp;gt;]] ([[Commons:Category:Bellows Falls, Vermont|cat]])&amp;#039;)&lt;br /&gt;
	-- P373 matches sitelink, category only&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | qid=Q2601154|bold=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Agama lionotus|&amp;lt;span style=&amp;quot;font-weight:bold;&amp;quot;&amp;gt;Agama lionotus&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- P910 matches P373, category only&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | qid=Q853037|italic=1|bold=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Bánhida|&amp;lt;span style=&amp;quot;font-style:italic; font-weight:bold;&amp;quot;&amp;gt;Bánhida&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
	-- P1754 matches P373, category only&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | qid=Q2551907}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Category:Lakes of Turkey|Lakes of Turkey]]&amp;#039;)&lt;br /&gt;
	-- missing data&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getGalleryAndCategory | qid=Q2963317|bold=1|linktext=Chicago Lawn|oneSearch=1}}&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Commons:Special:Search/Chicago Lawn, Chicago|&amp;lt;span style=&amp;quot;font-weight:bold;&amp;quot;&amp;gt;Chicago Lawn&amp;lt;/span&amp;gt;]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p:testTitleQID()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getTitleQID }}&amp;#039;,&amp;#039;Commons link/sandbox/testcases,Module talk,nil&amp;#039;)&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getTitleQID | Q42 | 1}}&amp;#039;,&amp;#039;Douglas Adams,,Q42&amp;#039;)&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getTitleQID | Q15048757 | 1}}&amp;#039;,&amp;#039;Python (genus),Category,Q15048757&amp;#039;)&lt;br /&gt;
	-- no page corresponding to QID&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getTitleQID | Q0}}&amp;#039;,&amp;#039;,Module talk,Q0&amp;#039;)&lt;br /&gt;
	-- QID doesn&amp;#039;t link back to en&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getTitleQID | Q68979196 | 1}}&amp;#039;,&amp;#039;,,Q68979196&amp;#039;)&lt;br /&gt;
	-- gibberish QID&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| getTitleQID | 1234}}&amp;#039;,&amp;#039;Commons link/sandbox/testcases,Module talk,nil&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:testLookupFallback()&lt;br /&gt;
	-- P910 doesn&amp;#039;t exist&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| lookupFallback | Q2217963 | P910}}&amp;#039;,&amp;#039;nil&amp;#039;)&lt;br /&gt;
	-- normal P910&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| lookupFallback | Q853037 | P910}}&amp;#039;,&amp;#039;Bánhida&amp;#039;)&lt;br /&gt;
	-- normal P1754&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| lookupFallback | Q2551907 | P1754}}&amp;#039;,&amp;#039;Lakes of Turkey&amp;#039;)&lt;br /&gt;
	-- gibberish prop string&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| lookupFallback | Q2551907 | xyzzy}}&amp;#039;,&amp;#039;nil&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:testTracking()&lt;br /&gt;
	local galPrefix = &amp;#039;[[Category:Commons link &amp;#039;&lt;br /&gt;
	local catPrefix = &amp;#039;[[Category:Commons category link &amp;#039;&lt;br /&gt;
	local onWikidata = &amp;#039;is on Wikidata]]&amp;#039;&lt;br /&gt;
	local definedAsPagename = &amp;#039;is defined as the pagename]]&amp;#039;&lt;br /&gt;
	local locallyDefined = &amp;#039;is locally defined]]&amp;#039;&lt;br /&gt;
	local fromWikidata = &amp;#039;from Wikidata]]&amp;#039;&lt;br /&gt;
	local isPagename = &amp;#039;is the pagename]]&amp;#039;&lt;br /&gt;
	local galInconsistent = &amp;#039;[[Category:Inconsistent wikidata for Commons gallery]]&amp;#039;&lt;br /&gt;
	local catInconsistent = &amp;#039;[[Category:Inconsistent wikidata for Commons category]]&amp;#039;&lt;br /&gt;
	-- default gallery is specified and is Commons gallery on wikidata&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking | Samuel Baker House | fetchGallery = 1 | fetchCategory = 1 | qid=Q2217963}}&amp;#039;,&lt;br /&gt;
		galPrefix..onWikidata,{nowiki=1})&lt;br /&gt;
	-- default gallery is specified and is Commons category on wikidata&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking | Fado | fetchGallery=1 | fetchCategory=1 | qid=Q185676}}&amp;#039;,&lt;br /&gt;
		galPrefix..definedAsPagename,{nowiki=1})&lt;br /&gt;
	-- default category is specified and is Commons category on wikidata&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking | Category:Fado | fetchCategory=1 | qid=Q8442543}}&amp;#039;,&lt;br /&gt;
		catPrefix..onWikidata,{nowiki=1})&lt;br /&gt;
	-- inconsistent wikidata returns nil, so doesn&amp;#039;t match title. Called from Template:Commons&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking | Municipality of Vipava | fetchGallery=1 | fetchCategory=1 | qid=Q1002229}}&amp;#039;,&lt;br /&gt;
		galPrefix..definedAsPagename,{nowiki=1})&lt;br /&gt;
	-- Default string is not the same as either title or wikidata. Called from Template:Commons&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking | Bellows Falls | fetchGallery = 1 | fetchCategory=1 | qid=Q816044}}&amp;#039;,&lt;br /&gt;
		galPrefix..locallyDefined,{nowiki=1})&lt;br /&gt;
	-- Default string is not the same as either title or wikidata. Called from Template:Commonscat&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking | Category:Bellows Falls | fetchCategory=1 | qid=Q816044}}&amp;#039;,&lt;br /&gt;
		catPrefix..locallyDefined,{nowiki=1})&lt;br /&gt;
	-- No string. Commons gallery on Wikidata&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking || fetchGallery=1 | fetchCategory=1 | qid=Q235539}}&amp;#039;,&lt;br /&gt;
		galPrefix..fromWikidata,{nowiki=1})&lt;br /&gt;
	-- No string. Commons category on Wikidata&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking || fetchCategory=1 | qid=Q121319}}&amp;#039;,&lt;br /&gt;
		catPrefix..fromWikidata,{nowiki=1})&lt;br /&gt;
	-- No string. Nothing on Wikidata. Called from Template:Commons&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking | fetchGallery=1| fetchCategory=1 | qid=Q2963317}}&amp;#039;,&lt;br /&gt;
		galPrefix..isPagename,{nowiki=1})&lt;br /&gt;
	-- No string. Nothing on Wikidata. Called from Template:CommonsCat&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking || fetchCategory=1 | qid=Q2963317}}&amp;#039;,&lt;br /&gt;
		catPrefix..isPagename,{nowiki=1})&lt;br /&gt;
	-- Inconsistent wikidata for category&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{#invoke:Commons link/sandbox| tracking |fetchCategory=1|qid=Q21032720}}&amp;#039;,&lt;br /&gt;
		catInconsistent,{nowiki=1})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Hike395</name></author>
	</entry>
</feed>