Для документации этого модуля может быть создана страница Модуль:WikidataSelectors/tests/doc

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

-- TODO: list of claims should be here

function p:test_formatUrl()
	-- General
    self:preprocess_equals('{{ wikidata | p18 }}', '')
    self:preprocess_equals('{{ wikidata | p18 [1] }}', '')
    self:preprocess_equals('{{ wikidata | p18 [1, 2] }}', '')
    self:preprocess_equals('{{ wikidata | p18 [2, 3] }}', '')
    self:preprocess_equals('{{ wikidata | p18 [1], p18 [2] }}', '')
    self:preprocess_equals('{{ wikidata | p18 [1, rank:deprecated] }}', '')
    self:preprocess_equals('{{ wikidata | p18 [rank:deprecated] }}', '')
    self:preprocess_equals('{{ wikidata | p18 [2, 3] [rank:deprecated] }}', '')
    self:preprocess_equals('{{ wikidata | p18 [rank:deprecated] [2, 3] }}', '')

    -- self:preprocess_equals('{{ wikidata | p166[p111>:1946][p111<:1972] }}', '')

	-- Movie
    -- self:preprocess_equals('{{ wikidata | p161 }}', '')
    -- self:preprocess_equals('{{ wikidata | p161[rank:preferred] }}', '')
    -- self:preprocess_equals('{{ wikidata | p161[1,3,5,7,9] }}', '')
    -- self:preprocess_equals('{{ wikidata | p161[2..4] }}', '')
    -- self:preprocess_equals('{{ wikidata | p161[2..] }}', '')
    -- self:preprocess_equals('{{ wikidata | p161[..4] }}', '')
    -- self:preprocess_equals('{{ wikidata | p161[2-4] }}', '')
    -- self:preprocess_equals('{{ wikidata | p161[2-] }}', '')
    -- self:preprocess_equals('{{ wikidata | p161[-4] }}', '')

	-- Software
    self:preprocess_equals('{{ wikidata | p348 }}', '')
    self:preprocess_equals('{{ wikidata | p348[p548:q2122918, p548:q3295609] }}', '')
    self:preprocess_equals('{{ wikidata | p348[!p548:q2122918, p548:q3295609] }}', '')
    self:preprocess_equals('{{ wikidata | p348[!p548:q2122918] }}', '')
    self:preprocess_equals('{{ wikidata | p348[p548!:q2122918] }}', '')
    self:preprocess_equals('{{ wikidata | p348[!p548:q2122918, !p548:q3295609] }}', '')
    self:preprocess_equals('{{ wikidata | p348[p548!:q2122918, p548!:q3295609] }}', '')
    self:preprocess_equals('{{ wikidata | p348[!p548:q2122918][!p548:q3295609] }}', '')
    self:preprocess_equals('{{ wikidata | p348[!p548:q2122918][p548:q3295609] }}', '')
    self:preprocess_equals('{{ wikidata | p348[p548] }}', '')
    self:preprocess_equals('{{ wikidata | p348[!p548] }}', '')
    self:preprocess_equals('{{ wikidata | p348[!p548, p548!:q2122918, p548!:q3295609] }}', '')
    self:preprocess_equals('{{ wikidata | p348[!p548, !p548:q2122918, p548!:q3295609] }}', '')
end

return p