--  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|Q668|P395}}', wdib._getValue{'P395',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|P395}}', '')
	self:preprocess_equals('{{#invoke:wd|property|eid=Q668|P395}}', wdib._getValue{'P395',qid='Q668',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{'Q668'} .. '|P395}}', '')
	self:preprocess_equals('{{#invoke:wd|property|:' .. wd._title{'Q668'} .. '|P395}}', wdib._getValue{'P395',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|page=' .. wd._title{'Q668'} .. '|P395}}', wdib._getValue{'P395',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|page=:' .. wd._title{'Q668'} .. '|P395}}', wdib._getValue{'P395',qid='Q668',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|Q668|P395}}', wdib._getValue{'P395',qid='Q668',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/Q668?uselang=en#P395|Edit this on Wikidata]]')
	self:preprocess_equals('{{#invoke:wd|property|edit@end|Q668|P395}}', wdib._getValue{'P395',qid='Q668',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/Q668?uselang=en#P395|Edit this on Wikidata]]</span>')
	self:preprocess_equals('{{#invoke:wd|property|eid=Q668|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{'Q668'} .. '|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{'Q668'} .. '|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+|Q668|P1082}}', wdib._getValue{'P1082',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|properties|normal+|Q668|P1082}}', table.concat({wdib._getValue{'P1082',qid='Q668',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P1082',qid='Q668',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', '))
	self:preprocess_equals('{{#invoke:wd|properties|qualifier|normal+|Q668|P1082|P585|format=%p[ (%q)][%s][%r]}}', table.concat({wdib._getValue{'P1082',qid='Q668',qual='P585',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, wdib._getValue{'P1082',qid='Q668',qual='P585',noicon='true',osd='no',df='dmy',rank='n',fwd='ALL'}}, ', '))
	self:preprocess_equals('{{#invoke:wd|property|Q668|P1082}}', wdib._getValue{'P1082',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|Q668|P1082|punc=.}}', wdib._getValue{'P1082',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}..'.')
	self:preprocess_equals('{{#invoke:wd|qualifier|normal+|Q668|P1082|P585}}', table.concat({wdib._getValue{'P1082',qid='Q668',qual='P585',qo='true',sep='; ',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, wdib._getValue{'P1082',qid='Q668',qual='P585',qo='true',sep='; ',noicon='true',osd='no',df='dmy',rank='n',fwd='ALL'}}, '; '))
	self:preprocess_equals('{{#invoke:wd|qualifier|normal+|single|Q668|P1082|P585}}', wdib._getValue{'P1082',qid='Q668',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|Q668|P1082|P585}}', wdib._getValue{'P1082',qid='Q668',qual='P585',qo='true',noicon='true',osd='no',df='mdy',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|properties|normal+|Q668|P1081|punc=,}}', ({mw.ustring.gsub(table.concat({wdib._getValue{'P1081',qid='Q668',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P1081',qid='Q668',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', ')..',', '([.]%d%d),', '%10,')})[1])
	self:preprocess_equals('{{#invoke:wd|properties|normal+|sourced|Q668|P1081|punc=,}}', ({mw.ustring.gsub(table.concat({wdib._getValue{'P1081',qid='Q668',noicon='true',rank='p',fwd='ALL'}, wdib._getValue{'P1081',qid='Q668',noicon='true',rank='n',fwd='ALL'}}, ', ')..',', '([.]%d%d),', '%10,')})[1])
--	self:preprocess_equals('{{#invoke:wd|qualifier|Q668|P2855|P518}}', ({string.gsub(wdib._getValue{'P2855',qid='Q668',qual='P518',qo='true',linked='false',noicon='true',osd='no',fwd='ALL'}, '^([^,]+).*$', '%1', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|qualifiers|Q668|P2855|P518}}', wdib._getValue{'P2855',qid='Q668',qual='P518',qo='true',linked='false',noicon='true',osd='no',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|properties|qualifiers|Q668|P2855|P518|format=%p[ (%q)][%s][%r]}}', ({string.gsub(wdib._getValue{'P2855',qid='Q668',qual='P518',linked='false',noicon='true',osd='no',fwd='ALL'}, ' percent', '%%')})[1])
	self:preprocess_equals('{{#invoke:wd|properties|qualifiers|Q668|P2855|P518|sep=_+_|sep%s=|sep%q=_/_|format=%p[ (%q)][%s][%r]}}', ({string.gsub(wdib._getValue{'P2855',qid='Q668',qual='P518',sep='" + "',qsep='" / "',linked='false',noicon='true',osd='no',fwd='ALL'}, ' percent', '%%')})[1])
	self:preprocess_equals('{{#invoke:wd|properties|qualifier|qualifier|normal+|Q668|P35|P580|P582|format=%p[ (%q)][%s][%r]}}', table.concat({({string.gsub(wdib._getValue{'P35',qid='Q668',qual='P580',qsep='"; "',linked='false',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, ' &ndash; ', '', 1)})[1], ({string.gsub(wdib._getValue{'P35',qid='Q668',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+|Q668|P35|P580|P582|sep%q=_–_|format=%p[ (%q)][%s][%r]}}', table.concat({({string.gsub(wdib._getValue{'P35',qid='Q668',qual='P580',qsep='" – "',linked='false',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, ' &ndash; ', '', 1)})[1], ({string.gsub(wdib._getValue{'P35',qid='Q668',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+|Q668|P35|P580|P582|format=%p[ (%q1[ – %q2])][%s][%r]}}', table.concat({({string.gsub(wdib._getValue{'P35',qid='Q668',qual='P580',qsep='" – "',linked='false',noicon='true',osd='no',df='dmy',rank='p',fwd='ALL'}, ' &ndash; ', '', 1)})[1], ({string.gsub(wdib._getValue{'P35',qid='Q668',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+|Q668|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|Q668|P38|P518|format=%p[ (%q)][%s][%r]}}', ({string.gsub(({string.gsub(table.concat({wdib._getValue{'P38',qid='Q668',qual='P518',linked='false',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P38',qid='Q668',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+|Q668|P38|format=%p[ (%q)][%s][%r]}}', ({string.gsub(table.concat({wdib._getValue{'P38',qid='Q668',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P38',qid='Q668',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', '), '([^|]+)|%1', '%1')})[1])
--	self:preprocess_equals('{{#invoke:wd|properties|linked|short|normal+|Q668|P38|format=%p[ (%q)][%s][%r]}}', ({string.gsub(table.concat({wdib._getValue{'P38',qid='Q668',sn='true',noicon='true',osd='no',rank='p',fwd='ALL'}, wdib._getValue{'P38',qid='Q668',sn='true',noicon='true',osd='no',rank='n',fwd='ALL'}}, ', '), '([^|]+)|%1', '%1')})[1])
	self:preprocess_equals('{{#invoke:wd|qualifiers|normal+|current|Q668|P38|Q4917|P518}}', wdib.getQualifierValue{args={'P38',qid='Q668',qual='P518',pval='Q4917',linked='false',noicon='true',osd='no',fwd='ALL'}})
	self:preprocess_equals('{{#invoke:wd|properties|normal+|current|Q668|P38|P518=Q27561}}', wdib.getValueByQual{args={'P38',qid='Q668',qualID='P518',qvalue='Q27561',linked='false',noicon='true',osd='no',fwd='ALL'}})
	self:preprocess_equals('{{#invoke:wd|properties|normal+|former|Q668|P38}}', 'Dutch guilder')
	self:preprocess_equals('{{#invoke:wd|properties|raw|normal+|former|Q668|P38}}', 'Q788472')
	self:preprocess_equals('{{#invoke:wd|properties|raw|linked|normal+|former|Q668|P38}}', '[[d:Q788472|Q788472]]')
	self:preprocess_equals('{{#invoke:wd|property|Q668|P1549}}', wdib._getValue{'P1549',qid='Q668',noicon='true',osd='no',rank='best',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|multilanguage|Q668|P1549|P407=Q36846}}', wdib.getValueByQual{args={'P1549',qid='Q668',qualID='P407',qvalue='Q36846',noicon='true',osd='no',fwd='ALL'}})
	self:preprocess_equals('{{#invoke:wd|property|Q668|P2884}}', wdib._getValue{'P2884',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|raw|Q668|P2884}}', wdib._getValue{'P2884',qid='Q668',su='false',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|unit|Q668|P2884}}', ({string.gsub(wdib._getValue{'P2884',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, '^[^ ]+ (.+)$', '%1', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|property|unit|linked|Q668|P2884}}', '[[' .. ({string.gsub(({string.gsub(wdib._getValue{'P2884',qid='Q668',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|Q668|P2884}}', 'Q25250')
	self:preprocess_equals('{{#invoke:wd|property|Q668|P625}}', ({string.gsub(({string.gsub(({string.gsub(wdib._getValue{'P625',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, "′", "'", 2)})[1], '″', '"', 2)})[1], ' ', ', ', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|property|linked|Q668|P625}}', '[https://tools.wmflabs.org/geohack/geohack.php?language=en&params=' ..  ({mw.ustring.gsub(wdib._getValue{'P625',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, '[°′″ ]', '_')})[1] .. '_globe:earth ' .. ({string.gsub(({string.gsub(({string.gsub(wdib._getValue{'P625',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, "′", "'", 2)})[1], '″', '"', 2)})[1], ' ', ', ', 1)})[1] .. ']')
	self:preprocess_equals('{{#invoke:wd|property|raw|Q668|P625}}', ({mw.ustring.gsub(wdib._getValue{'P625',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, '[°′″ ]', '/')})[1])
	self:preprocess_equals('{{#invoke:wd|property|Q668|coord}}', ({string.gsub(({string.gsub(({string.gsub(wdib._getValue{'P625',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'}, "′", "'", 2)})[1], '″', '"', 2)})[1], ' ', ', ', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|property|linked|Q668|P41}}', '[[c:File:' .. wdib._getValue{'P41',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'} .. '|' .. wdib._getValue{'P41',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'} .. ']]')
	self:preprocess_equals('{{#invoke:wd|property|raw|Q668|P41}}', wdib._getValue{'P41',qid='Q668',noicon='true',osd='no',rank='best',maxvals='1',fwd='ALL'})
	self:preprocess_equals('{{#invoke:wd|property|raw|date=1700-05-06|Q668|P41}}', 'Statenvlag.svg')
	self:preprocess_equals('{{#invoke:wd|property|raw|date=1700-05-06|former|Q668|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:Property:P38|' .. wdib.getLabel{args={'P38'}} .. ']]')
	self:preprocess_equals('{{#invoke:wd|label|Q1159}}', wdib.getLabel{args={'Q1159'}})
	self:preprocess_equals('{{#invoke:wd|label|linked|Q1159}}', ({string.gsub(wdib.getLink{args={'Q1159'}}, '%[%[:', '[[', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|label|eid=Q1159}}', wdib.getLabel{args={'Q1159'}})
	self:preprocess_equals('{{#invoke:wd|label|:' .. wd._title{'Q1159'} .. '}}', wdib.getLabel{args={'Q1159'}})
	self:preprocess_equals('{{#invoke:wd|label|page=' .. wd._title{'Q1159'} .. '}}', wdib.getLabel{args={'Q1159'}})
	self:preprocess_equals('{{#invoke:wd|label|page=:' .. wd._title{'Q1159'} .. '}}', wdib.getLabel{args={'Q1159'}})
	self:preprocess_equals('{{#invoke:wd|label|eid=Q1159|Q2}}', wdib.getLabel{args={'Q2'}})
	self:preprocess_equals('{{#invoke:wd|label|page=' .. wd._title{'Q1159'} .. '|Q2}}', wdib.getLabel{args={'Q2'}})
	self:preprocess_equals('{{#invoke:wd|label|page=' .. wd._title{'Q1159'} .. '|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|Q1159}}', 'Q1159')
	self:preprocess_equals('{{#invoke:wd|label|raw|linked|Q1159}}', '[[d:Q1159|Q1159]]')
	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|Q1159}}', wdib.getSiteLink{args={qid='Q1159'}})
	self:preprocess_equals('{{#invoke:wd|title|linked|Q1159}}', '[[' .. wdib.getSiteLink{args={qid='Q1159'}} .. ']]')
	self:preprocess_equals('{{#invoke:wd|title}}', '')
	self:preprocess_equals('{{#invoke:wd|description|Q668}}', wdib.getDescription{args={qid='Q668','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|Q668}}', ({string.gsub(wdib.getAliases{args={qid='Q668',noicon='true',fwd='ALL'}}, '^([^,]+).*$', '%1', 1)})[1])
	self:preprocess_equals('{{#invoke:wd|aliases|Q668}}', wdib.getAliases{args={qid='Q668',noicon='true',fwd='ALL'}})
	self:preprocess_equals('{{#invoke:wd|alias|linked|Q668}}', '[[' .. wdib.getSiteLink{args={qid='Q668'}} .. '|' .. ({string.gsub(wdib.getAliases{args={qid='Q668',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