Module:Wikidata/testcases: Difference between revisions

Content deleted Content added
raw
+wikidataIB
Line 2:
local p = require('Module:UnitTests')
 
function p:test_hellotest_Wikidata()
self:preprocess_equals('{{#invoke:Bananas | hello}}', 'Hello, world!')
self:preprocess_equals('{{#invoke:Wikidata|getValue|P19|FETCH_WIKIDATA}}', '')
self:preprocess_equals('{{#invoke:Wikidata|getValue|P26|FETCH_WIKIDATA}}', '')
Line 17 ⟶ 16:
self:preprocess_equals('{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|mdy}}', '')
self:preprocess_equals('{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}', '')
end
 
function p:test_WikidataIB()
self:preprocess_equals('{{#invoke:WikidataIB|getValue|P178|name=developer |suppressfields= |fetchwikidata = developer; license; | [[Proprietary software]] except for open-source components | onlysourced = false}}', '')
self:preprocess_equals('{{#invoke:WikidataIB|getValue|P275|name=license |suppressfields= |fetchwikidata = developer; license; |{{{developer|}}} | onlysourced = false}}', '')
self:preprocess_equals('{{#invoke:Bananas | hello}}', 'Hello, world!')
end