跳转到内容

模組:Wikidata/testcases

维基百科,自由的百科全书
-- Example Unit tests for [[Module:Bananas]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_Wikidata()
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P19|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P26|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P27|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P140|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P178|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P275|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P140|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue|P140|qid=Q48493|FETCH_WIKIDATA2}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P178|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P275|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P140|qid=Q48493|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P140|qid=Q48493|FETCH_WIKIDATA2}}', '')

    self:preprocess_equals('{{#invoke:Wikidata|getRawValue|P21|FETCH_WIKIDATA}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|dmy}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|mdy}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|getValue}}', '')
    self:preprocess_equals('{{#invoke:Wikidata|tableMerge}}', '')
end

return p