Jump to content

Module:Wd/testcases/1

From Wikipedia, the free encyclopedia

--  Unit tests for [[Module:Wd]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local wdib = require('Module:WikidataIB')
local wd = require('Module:Wd')

function p:test_live()
	self:preprocess_equals('{{#invoke:wd|property|Q55|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|P395}}', '')
	self:preprocess_equals('{{#invoke:wd|property|eid=Q55|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|eid=|P395}}', '')
	self:preprocess_equals('{{#invoke:wd|property|' .. wd._title{'Q55'} .. '|P395}}', '')
	self:preprocess_equals('{{#invoke:wd|property|:' .. wd._title{'Q55'} .. '|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|page=' .. wd._title{'Q55'} .. '|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|page=:' .. wd._title{'Q55'} .. '|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|page=|P395}}', '')
	self:preprocess_equals('{{#invoke:wd|property|edit|Q55|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'} .. ' [[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=Edit this on Wikidata|link=https://www.wikidata.org/wiki/Q55?uselang=en#P395|Edit this on Wikidata]]')
	self:preprocess_equals('{{#invoke:wd|property|edit@end|Q55|P395}}', wdib._getValue{'P395',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'} .. '<span style="float:right">[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=Edit this on Wikidata|link=https://www.wikidata.org/wiki/Q55?uselang=en#P395|Edit this on Wikidata]]</span>')
	self:preprocess_equals('{{#invoke:wd|property|eid=Q55|Q2|P31}}', wdib._getValue{'P31',qid='Q2',linked='false',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|page=' .. wd._title{'Q55'} .. '|Q2|P31}}', wdib._getValue{'P31',qid='Q2',linked='false',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|page=' .. wd._title{'Q55'} .. '|eid=Q2|P31}}', wdib._getValue{'P31',qid='Q2',linked='false',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|P625|P31}}', '')
	self:preprocess_equals('{{#invoke:wd|property|Property:P625|P31}}', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|eid=P625|P31}}', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|eid=Property:P625|P31}}', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|coord|P31}}', '')
	self:preprocess_equals('{{#invoke:wd|property|Property:coord|P31}}', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|eid=coord|P31}}', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|eid=Property:coord|P31}}', wdib._getValue{'P31',qid='P625',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|invalid|P31}}', '')
	self:preprocess_equals('{{#invoke:wd|property|Property:invalid|P31}}', '')
	self:preprocess_equals('{{#invoke:wd|property|eid=invalid|P31}}', '')
	self:preprocess_equals('{{#invoke:wd|property|eid=Property:invalid|P31}}', '')
	self:preprocess_equals('{{#invoke:wd|property|normal+|Q55|P1082}}', wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|properties|normal+|Q55|P1082}}', table.concat({wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', '))
	self:preprocess_equals('{{#invoke:wd|properties|qualifier|normal+|Q55|P1082|P585|format=%p[ (%q)][%s][%r]}}', table.concat({wdib._getValue{'P1082',qid='Q55',qual='P585',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, wdib._getValue{'P1082',qid='Q55',qual='P585',noicon='true',osd='no',df='dmy',rank='n',fwd='ALL'}}, ', '))
	self:preprocess_equals('{{#invoke:wd|property|Q55|P1082}}', wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|Q55|P1082|punc=.}}', wdib._getValue{'P1082',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}..'.')
	self:preprocess_equals('{{#invoke:wd|qualifier|normal+|Q55|P1082|P585}}', table.concat({wdib._getValue{'P1082',qid='Q55',qual='P585',qo='true',sep='; ',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, wdib._getValue{'P1082',qid='Q55',qual='P585',qo='true',sep='; ',noicon='true',osd='no',df='dmy',rank='n',fwd='ALL'}}, '; '))
	self:preprocess_equals('{{#invoke:wd|qualifier|normal+|single|Q55|P1082|P585}}', wdib._getValue{'P1082',qid='Q55',qual='P585',qo='true',noicon='true',osd='no',df='dmy',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|qualifier|normal+|single|mdy|Q55|P1082|P585}}', wdib._getValue{'P1082',qid='Q55',qual='P585',qo='true',noicon='true',osd='no',df='mdy',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|properties|normal+|Q55|P1081|punc=,}}', ({mw.ustring.gsub(table.concat({wdib._getValue{'P1081',qid='Q55',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P1081',qid='Q55',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', ')..',', '([.]%d%d),', '%10,')})[1])
	self:preprocess_equals('{{#invoke:wd|properties|normal+|sourced|Q55|P1081|punc=,}}', ({mw.ustring.gsub(table.concat({wdib._getValue{'P1081',qid='Q55',noicon='true',rank='p',fwd='ALL'}, wdib._getValue{'P1081',qid='Q55',noicon='true',rank='n',fwd='ALL'}}, ', ')..',', '([.]%d%d),', '%10,')})[1])
	self:preprocess_equals('{{#invoke:wd|qualifier|Q55|P2855|P518}}', ({string.gsub(wdib._getValue{'P2855',qid='Q55',qual='P518',qo='true',linked='false',noicon='true',osd='no',fwd='ALL'}, '^([^,]+).*$', '%1', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|qualifiers|Q55|P2855|P518}}', wdib._getValue{'P2855',qid='Q55',qual='P518',qo='true',linked='false',noicon='true',osd='no',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|properties|qualifiers|Q55|P2855|P518|format=%p[ (%q)][%s][%r]}}', ({string.gsub(wdib._getValue{'P2855',qid='Q55',qual='P518',linked='false',noicon='true',osd='no',fwd='ALL'}, ' percent', '%%')})[1])
	self:preprocess_equals('{{#invoke:wd|properties|qualifiers|Q55|P2855|P518|sep=_+_|sep%s=|sep%q=_/_|format=%p[ (%q)][%s][%r]}}', ({string.gsub(wdib._getValue{'P2855',qid='Q55',qual='P518',sep='" + "',qsep='" / "',linked='false',noicon='true',osd='no',fwd='ALL'}, ' percent', '%%')})[1])
	self:preprocess_equals('{{#invoke:wd|properties|qualifier|qualifier|normal+|Q55|P35|P580|P582|format=%p[ (%q)][%s][%r]}}', table.concat({({string.gsub(wdib._getValue{'P35',qid='Q55',qual='P580',qsep='"; "',linked='false',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, ' &ndash; ', '', 1)})[1], ({string.gsub(wdib._getValue{'P35',qid='Q55',qual='P580,P582',qsep='"; "',linked='false',noicon='true',osd='no',df='dmy',rank='n',fwd='ALL'}, ' &ndash; ', '; ')})[1]}, ', '))
	self:preprocess_equals('{{#invoke:wd|properties|qualifier|qualifier|normal+|Q55|P35|P580|P582|sep%q=_–_|format=%p[ (%q)][%s][%r]}}', table.concat({({string.gsub(wdib._getValue{'P35',qid='Q55',qual='P580',qsep='" – "',linked='false',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, ' &ndash; ', '', 1)})[1], ({string.gsub(wdib._getValue{'P35',qid='Q55',qual='P580,P582',qsep='" – "',linked='false',noicon='true',osd='no',df='dmy',rank='n',fwd='ALL'}, ' &ndash; ', ' – ')})[1]}, ', '))
	self:preprocess_equals('{{#invoke:wd|properties|qualifier|qualifier|normal+|Q55|P35|P580|P582|format=%p[ (%q1[ – %q2])][%s][%r]}}', table.concat({({string.gsub(wdib._getValue{'P35',qid='Q55',qual='P580',qsep='" – "',linked='false',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, ' &ndash; ', '', 1)})[1], ({string.gsub(wdib._getValue{'P35',qid='Q55',qual='P580,P582',qsep='" – "',linked='false',noicon='true',osd='no',df='dmy',rank='n',fwd='ALL'}, ' &ndash; ', ' – ')})[1]}, ', '))
	self:preprocess_equals('{{#invoke:wd|properties|qualifier|raw|qualifier|normal+|Q55|P35|Q29574|P580|P582|format=%p[ (%q1[ – %q2])][%s][%r]}}', 'Beatrix of the Netherlands (1980-04-30 – 30 April 2013)')
	self:preprocess_equals('{{#invoke:wd|properties|qualifiers|normal+|current|Q55|P38|P518|format=%p[ (%q)][%s][%r]}}', ({string.gsub(({string.gsub(table.concat({wdib._getValue{'P38',qid='Q55',qual='P518',linked='false',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P38',qid='Q55',qual='P518',linked='false',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', '), 'Dutch guilder[^,]*', '', 1)})[1], ', ,', ',', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|properties|linked|normal+|Q55|P38|format=%p[ (%q)][%s][%r]}}', ({string.gsub(table.concat({wdib._getValue{'P38',qid='Q55',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P38',qid='Q55',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', '), '([^|]+)|%1', '%1')})[1])
	self:preprocess_equals('{{#invoke:wd|properties|linked|short|normal+|Q55|P38|format=%p[ (%q)][%s][%r]}}', ({string.gsub(table.concat({wdib._getValue{'P38',qid='Q55',sn='true',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P38',qid='Q55',sn='true',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', '), '([^|]+)|%1', '%1')})[1])
	self:preprocess_equals('{{#invoke:wd|qualifiers|normal+|current|Q55|P38|Q4917|P518}}', wdib.getQualifierValue{args={'P38',qid='Q55',qual='P518',pval='Q4917',linked='false',noicon='true',osd='no',fwd='ALL'}})
	self:preprocess_equals('{{#invoke:wd|properties|normal+|current|Q55|P38|P518=Q27561}}', wdib.getValueByQual{args={'P38',qid='Q55',qualID='P518',qvalue='Q27561',linked='false',noicon='true',osd='no',fwd='ALL'}})
	self:preprocess_equals('{{#invoke:wd|properties|normal+|former|Q55|P38}}', 'Dutch guilder')
	self:preprocess_equals('{{#invoke:wd|properties|raw|normal+|former|Q55|P38}}', 'Q788472')
	self:preprocess_equals('{{#invoke:wd|properties|raw|linked|normal+|former|Q55|P38}}', '[[d:Special:EntityPage/Q788472|Q788472]]')
	self:preprocess_equals('{{#invoke:wd|property|Q55|P1549}}', wdib._getValue{'P1549',qid='Q55',noicon='true',osd='no',rank='best',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|multilanguage|Q55|P1549|P407=Q36846}}', wdib.getValueByQual{args={'P1549',qid='Q55',qualID='P407',qvalue='Q36846',noicon='true',osd='no',fwd='ALL'}} or '')
	self:preprocess_equals('{{#invoke:wd|property|Q55|P2884}}', wdib._getValue{'P2884',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|raw|Q55|P2884}}', wdib._getValue{'P2884',qid='Q55',su='false',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|unit|Q55|P2884}}', ({string.gsub(wdib._getValue{'P2884',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, '^[^ ]+ (.+)$', '%1', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|property|unit|linked|Q55|P2884}}', '[[' .. ({string.gsub(({string.gsub(wdib._getValue{'P2884',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, '^[^ ]+ (.+)$', '%1|%1', 1)})[1], '^.', string.upper, 1)})[1] .. ']]')
	self:preprocess_equals('{{#invoke:wd|property|unit|raw|Q55|P2884}}', 'Q25250')
	self:preprocess_equals('{{#invoke:wd|property|Q55|P625}}', ({string.gsub(({string.gsub(({string.gsub(wdib._getValue{'P625',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, "′", "'", 2)})[1], '″', '"', 2)})[1], ' ', ', ', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|property|linked|Q55|P625}}', '[https://geohack.toolforge.org/geohack.php?language=en&params=' ..  ({mw.ustring.gsub(wdib._getValue{'P625',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, '[°′″ ]', '_')})[1] .. '_globe:earth ' .. ({string.gsub(({string.gsub(({string.gsub(wdib._getValue{'P625',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, "′", "'", 2)})[1], '″', '"', 2)})[1], ' ', ', ', 1)})[1] .. ']')
	self:preprocess_equals('{{#invoke:wd|property|raw|Q55|P625}}', ({mw.ustring.gsub(wdib._getValue{'P625',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, '[°′″ ]', '/')})[1])
	self:preprocess_equals('{{#invoke:wd|property|Q55|coord}}', ({string.gsub(({string.gsub(({string.gsub(wdib._getValue{'P625',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, "′", "'", 2)})[1], '″', '"', 2)})[1], ' ', ', ', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|property|linked|Q55|P41}}', '[[c:File:' .. wdib._getValue{'P41',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'} .. '|' .. wdib._getValue{'P41',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'} .. ']]')
	self:preprocess_equals('{{#invoke:wd|property|raw|Q55|P41}}', wdib._getValue{'P41',qid='Q55',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|raw|date=1700-05-06|Q55|P41}}', 'Statenvlag.svg')
	self:preprocess_equals('{{#invoke:wd|property|raw|date=1700-05-06|former|Q55|P41}}', 'Prinsenvlag.svg')
	self:preprocess_equals('{{#invoke:wd|property|raw|Q915684|P2534}}', '\\frac{n^2 - 1}{n^2 + 2} = \\frac{4 \\pi}{3} N \\alpha')
	self:preprocess_equals('{{#invoke:wd|property|linked|Q6256|P3896}}', '[[c:' .. mw.getCurrentFrame():callParserFunction{name='#property:P3896',args={from='Q6256'}} .. '|' .. mw.getCurrentFrame():callParserFunction{name='#property:P3896',args={from='Q6256'}} .. ']]')
	self:preprocess_equals('{{#invoke:wd|label|Q4917}}', wdib.getLabel{args={'Q4917'}})
	self:preprocess_equals('{{#invoke:wd|label|linked|Q4917}}', ({string.gsub(wdib.getLink{args={'Q4917'}}, ':([^|]+)|%1', '%1', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|label|P38}}', wdib.getLabel{args={'P38'}})
	self:preprocess_equals('{{#invoke:wd|label|linked|P38}}', '[[d:Special:EntityPage/P38|' .. wdib.getLabel{args={'P38'}} .. ']]')
	self:preprocess_equals('{{#invoke:wd|label|Q776}}', wdib.getLabel{args={'Q776'}})
	self:preprocess_equals('{{#invoke:wd|label|linked|Q776}}', ({string.gsub(wdib.getLink{args={'Q776'}}, '%[%[:', '[[', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|label|eid=Q776}}', wdib.getLabel{args={'Q776'}})
	self:preprocess_equals('{{#invoke:wd|label|:' .. wd._title{'Q776'} .. '}}', wdib.getLabel{args={'Q776'}})
	self:preprocess_equals('{{#invoke:wd|label|page=' .. wd._title{'Q776'} .. '}}', wdib.getLabel{args={'Q776'}})
	self:preprocess_equals('{{#invoke:wd|label|page=:' .. wd._title{'Q776'} .. '}}', wdib.getLabel{args={'Q776'}})
	self:preprocess_equals('{{#invoke:wd|label|eid=Q776|Q2}}', wdib.getLabel{args={'Q2'}})
	self:preprocess_equals('{{#invoke:wd|label|page=' .. wd._title{'Q776'} .. '|Q2}}', wdib.getLabel{args={'Q2'}})
	self:preprocess_equals('{{#invoke:wd|label|page=' .. wd._title{'Q776'} .. '|eid=Q2}}', wdib.getLabel{args={'Q2'}})
	self:preprocess_equals('{{#invoke:wd|label}}', '')
	self:preprocess_equals('{{#invoke:wd|label|eid=}}', '')
	self:preprocess_equals('{{#invoke:wd|label|raw}}', '')
	self:preprocess_equals('{{#invoke:wd|label|raw|Q776}}', 'Q776')
	self:preprocess_equals('{{#invoke:wd|label|raw|linked|Q776}}', '[[d:Special:EntityPage/Q776|Q776]]')
	self:preprocess_equals('{{#invoke:wd|label|P625}}', wdib.getLabel{args={'P625'}})
	self:preprocess_equals('{{#invoke:wd|label|Property:P625}}', wdib.getLabel{args={'P625'}})
	self:preprocess_equals('{{#invoke:wd|label|eid=P625}}', wdib.getLabel{args={'P625'}})
	self:preprocess_equals('{{#invoke:wd|label|eid=Property:P625}}', wdib.getLabel{args={'P625'}})
	self:preprocess_equals('{{#invoke:wd|label|coord}}', wdib.getLabel{args={'P625'}})
	self:preprocess_equals('{{#invoke:wd|label|Property:coord}}', wdib.getLabel{args={'P625'}})
	self:preprocess_equals('{{#invoke:wd|label|eid=coord}}', wdib.getLabel{args={'P625'}})
	self:preprocess_equals('{{#invoke:wd|label|eid=Property:coord}}', wdib.getLabel{args={'P625'}})
	self:preprocess_equals('{{#invoke:wd|label|invalid}}', '')
	self:preprocess_equals('{{#invoke:wd|label|Property:invalid}}', '')
	self:preprocess_equals('{{#invoke:wd|label|eid=invalid}}', '')
	self:preprocess_equals('{{#invoke:wd|label|eid=Property:invalid}}', '')
	self:preprocess_equals('{{#invoke:wd|label|raw|Q6}}', '')
	self:preprocess_equals('{{#invoke:wd|label|raw|Q10000000000}}', '')
	self:preprocess_equals('{{#invoke:wd|label|raw|P3}}', '')
	self:preprocess_equals('{{#invoke:wd|label|raw|P10000000000}}', '')
	self:preprocess_equals('{{#invoke:wd|title|Q776}}', wdib.getSiteLink{args={qid='Q776'}})
	self:preprocess_equals('{{#invoke:wd|title|linked|Q776}}', '[[' .. wdib.getSiteLink{args={qid='Q776'}} .. ']]')
	self:preprocess_equals('{{#invoke:wd|title}}', '')
	self:preprocess_equals('{{#invoke:wd|description|Q55}}', wdib.getDescription{args={qid='Q55','wikidata'}})
	self:preprocess_equals('{{#invoke:wd|description}}', '')
	self:preprocess_equals('{{#invoke:wd|description|Q6}}', '')
	self:preprocess_equals('{{#invoke:wd|description|Q10000000000}}', '')
	self:preprocess_equals('{{#invoke:wd|description|P3}}', '')
	self:preprocess_equals('{{#invoke:wd|description|P10000000000}}', '')
	self:preprocess_equals('{{#invoke:wd|alias|Q55}}', ({string.gsub(wdib.getAliases{args={qid='Q55',noicon='true',fwd='ALL'}}, '^([^,]+).*$', '%1', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|aliases|Q55}}', wdib.getAliases{args={qid='Q55',noicon='true',fwd='ALL'}})
	self:preprocess_equals('{{#invoke:wd|alias|linked|Q55}}', '[[' .. wdib.getSiteLink{args={qid='Q55'}} .. '|' .. ({string.gsub(wdib.getAliases{args={qid='Q55',noicon='true',fwd='ALL'}}, '^([^,]+).*$', '%1', 1)})[1] .. ']]')
	self:preprocess_equals('{{#invoke:wd|alias}}', '')
	self:preprocess_equals('{{#invoke:wd|badges|Q2}}', 'featured article badge')
	self:preprocess_equals('{{#invoke:wd|badges|raw|Q2}}', 'Q17437796')
	self:preprocess_equals('{{#invoke:wd|badges}}', '')
end

return p