Content deleted Content added
Fred Gandt (talk | contribs) saving in incomplete state due to need to shut computer down |
Fred Gandt (talk | contribs) saving for a quick test |
||
Line 3:
local p = require('Module:UnitTests')
--[[ empty params ]]
function p:no_name_param()
Line 12 ⟶ 14:
end
function p:
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/explicit short description|only=}}', "explicit short description")
end
function p:
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=
end▼
function p:no_fallback_value()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/no explicit short description|
end
--[[ none but name ]]
function p:explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=
end
Line 24 ⟶ 36:
end
function p:
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Wikipedia}}', "Free multilingual, online, crowdsourced encyclopedia")
end
function p:explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Example}}', "Wikimedia disambiguation page")
end
--[[ name and only ]]
function p:only_explicit__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/explicit short description|only=explicit}}', "explicit short description")
end
function p:only_wikidata__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/explicit short description|only=wikidata}}', "")
end
function p:only_explicit__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/no explicit short description|only=explicit}}', "")
end
function p:only_wikidata__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/no explicit short description|only=wikidata}}', "")
end
function p:only_explicit__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Wikipedia|only=explicit}}', "Free multilingual, online, crowdsourced encyclopedia")
end
function p:only_wikidata__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Wikipedia|only=wikidata}}', "free multilingual online encyclopedia")
end
function p:only_explicit__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Example|only=explicit}}', "")
end
function p:only_wikidata__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Example|only=wikidata}}', "Wikimedia disambiguation page")
end
--[[ name and prefer ]]
▲ self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/explicit short description|only=wikidata}}', "")
function p:prefer_explicit__explicit_exists__wikidata_does_not_exist()▼
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/explicit short description|prefer=explicit}}', "explicit short description")
end
function p:prefer_wikidata__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/explicit short description|prefer=wikidata}}', "explicit short description")
end
function p:prefer_explicit__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/no explicit short description|prefer=explicit}}', "")
end
function p:prefer_wikidata__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/no explicit short description|prefer=wikidata}}', "")
end
Line 44 ⟶ 100:
end
function p:prefer_wikidata__explicit_exists__wikidata_exists()
▲function p:prefer_explicit__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=
end
Line 52 ⟶ 108:
end
function p:prefer_wikidata__explicit_does_not_exist__wikidata_exists()
▲ self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Wikipedia|prefer=wikidata}}', "Free multilingual, online, crowdsourced encyclopedia")
▲end
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=Example|prefer=wikidata}}', "Wikimedia disambiguation page")
end
--[[ everything below here is being replaced ]]
------------------------
|