Module:Wikidata label/testcases
Documentation for this module may be created at Module:Wikidata label/testcases/doc
Code
-- Unit tests for [[Module:Wikidata label]] date function. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_city_links()
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Q84|lang=en|link=wikidata}}', '[[d:Q84|London]]')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Q84|lang=en|link=wikidata|show_id=1}}', '[[d:Q84|London <small>(Q84)</small>]]')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Q84|lang=ar|link=wikidata|show_id=1}}', '[[d:Q84|لندن <small>(Q84)</small>]]')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Q84|lang=en|link=commons}}', '[[c:London|London]]')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Q64|lang=ru|link=commons}}', '[[c:Berlin|Берлин]]')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Q24955912|lang=cs|link=-}}', 'Herb Conn')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Q469872|lang=mk}}', '[[w:en:Lynn Hill|Lynn Hill]]')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Q7186|lang=pl}}', '[[w:pl:Maria Skłodowska-Curie|Maria Skłodowska-Curie]]')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=P25|lang=de}}', '[[d:Property:P25|Mutter]]')
self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=Property:P25|lang=en}}', '[[d:Property:P25|mother]]')
-- self:preprocess_equals('{{#invoke:Wikidata label | getLabel |item=John|lang=en}}', '<strong class="error"><span class="scribunto-error" id="mw-scribunto-error-0">The ID "John" is unknown to the system. Please use a valid entity ID.</span></strong>')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en}}', '[[w:en:Authority control|authority control]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=36524|lang=en}}', '[[w:en:Authority control|authority control]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=ru}}', '[[w:ru:Нормативный контроль|нормативный контроль]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q937|lang=he}}', '[[w:he:אלברט איינשטיין|אלברט איינשטיין]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en|capitalization=ucfirst|link=-}}', 'Authority control')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en|capitalization=lcfirst|link=-}}', 'authority control')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en|capitalization=uc|link=-}}', 'AUTHORITY CONTROL')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en|capitalization=lc|link=-}}', 'authority control')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en|link=Wikipedia}}', '[[w:en:Authority control|authority control]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en|link=WIKIDATA}}', '[[d:Q36524|authority control]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en|link=WIKIDATA talk}}', '[[d:Talk:Q36524|authority control]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q937|lang=fr|link=Commons}}', '[[c:Albert Einstein|Albert Einstein]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q6974121|lang=en|link=Commons}}', '[[c:Category:Israeli Cartoon Museum|Israeli Cartoon Museum]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=P31|lang=en}}', '[[d:Property:P31|instance of]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Property:P31|lang=en}}', '[[d:Property:P31|instance of]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=P31|lang=en|link=wikidata talk}}', '[[d:Property talk:P31|instance of]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=P31|lang=en|show_id=1}}', '[[d:Property:P31|instance of <small>(P31)</small>]]')
self:preprocess_equals('{{#invoke:Wikidata label|getLabel|item=Q36524|lang=en|show_id=1}}', '[[w:en:Authority control|authority control <small>(Q36524)</small>]]')
end
return p