function p:test__no_prefer_value()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/explicit short description|prefer=}}', "Explicit short description")
end
function p:test__no_fallback_value()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/no explicit short description|fallback=}}', "")
end
function p:test__prefer_wikidata__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Example|prefer=wikidata}}', "Wikimedia disambiguation page")
end
--[[ name and fallback ]]
function p:test__fallback__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/explicit short description|fallback=fallback}}', "Explicit short description")
end
function p:test__fallback__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/no explicit short description|fallback=fallback}}', "fallback")
end
function p:test__fallback__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Wikipedia|fallback=fallback}}', "Free multilingual, online, crowdsourced encyclopedia")
end
function p:test__fallback__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Example|fallback=fallback}}', "table")
end
--[[ name, only and fallback ]]
function p:test__only_explicit__fallback__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/explicit short description|only=explicit|fallback=fallback}}', "Explicit short description")
end
function p:test__only_wikidata__fallback__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/explicit short description|only=wikidata|fallback=fallback}}', "fallback")
end
function p:test__only_explicit__fallback__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/no explicit short description|only=explicit|fallback=fallback}}', "fallback")
end
function p:test__only_wikidata__fallback__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/no explicit short description|only=wikidata|fallback=fallback}}', "fallback")
end
function p:test__only_explicit__fallback__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Wikipedia|only=explicit|fallback=fallback}}', "Free multilingual, online, crowdsourced encyclopedia")
end
function p:test__only_wikidata__fallback__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Wikipedia|only=wikidata|fallback=fallback}}', "free multilingual online encyclopedia")
end
function p:test__only_explicit__fallback__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Example|only=explicit|fallback=fallback}}', "fallback")
end
function p:only_wikidata__fallback__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Example|only=wikidata|fallback=fallback}}', "Wikimedia disambiguation page")
end
--[[ name, prefer and fallback ]]
function p:test__prefer_explicit__fallback__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/explicit short description|prefer=explicit|fallback=fallback}}', "Explicit short description")
end
function p:test__prefer_wikidata__fallback__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/explicit short description|prefer=wikidata|fallback=fallback}}', "Explicit short description")
end
function p:test__prefer_explicit__fallback__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/no explicit short description|prefer=explicit|fallback=fallback}}', "fallback")
end
function p:test__prefer_wikidata__fallback__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=User:Fred Gandt/sandbox/no explicit short description|prefer=wikidata|fallback=fallback}}', "fallback")
end
function p:test__prefer_explicit__fallback__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Wikipedia|prefer=explicit|fallback=fallback}}', "Free multilingual, online, crowdsourced encyclopedia")
end
function p:test__prefer_wikidata__fallback__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Wikipedia|prefer=wikidata|fallback=fallback}}', "free multilingual online encyclopedia")
end
function p:test__prefer_explicit__fallback__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Example|prefer=explicit|fallback=fallback}}', "table")
end
function p:test__prefer_wikidata__fallback__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription/sandbox|main|name=Example|prefer=wikidata|fallback=fallback}}', "Wikimedia disambiguation page")
end
--[[ conflicting params ]]
--[[ only=explicit and prefer=wikidata ]]
|