Content deleted Content added
Fred Gandt (talk | contribs) fix test for nonexistent page |
Fred Gandt (talk | contribs) few fixes |
||
(9 intermediate revisions by the same user not shown) | |||
Line 7:
function p:test__no_name_param()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes}}', '<span style="color:#d33">[[Module:GetShortDescription]] requires a page name (including namespace).</span>[[Category:Pages displaying alarming messages about Module:GetShortDescription]]', {nowiki = 1})
end
function p:test__no_name_value()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=}}', '<span style="color:#d33">[[Module:GetShortDescription]] requires a page name (including namespace).</span>[[Category:Pages displaying alarming messages about Module:GetShortDescription]]', {nowiki = 1})
end
function p:test__no_only_value()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__no_prefer_value()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__no_objectify_alarm_value()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|objectify_alarm=}}', '<span style="color:#d33">[[Module:GetShortDescription]] requires a page name (including namespace).</span>[[Category:Pages displaying alarming messages about Module:GetShortDescription]]', {nowiki = 1})
end
Line 33 ⟶ 29:
function p:test__nonexistent_page_name()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
Line 39 ⟶ 35:
function p:test__unknown_param_with_no_value_offered()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__unknown_param_with_value_offered()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
Line 49 ⟶ 45:
function p:test__unknown_param_found()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__complex_unknown_params_found()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
--[[ multiple short descriptions ]]
--[[ temporarily disabled re other solution required
function p:test__two_short_descriptions_numbered_after()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__two_short_descriptions_numbered_before()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
]]
function p:test__two_short_description_templates()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__two_short_description_templates__first_noreplace()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__two_short_description_templates__second_noreplace()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__three_short_description_templates__second_noreplace()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__three_short_description_templates__second_none__third_noreplace()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
Line 89:
function p:test__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Wikipedia}}', "Free
end
function p:test__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Example}}', "Wikimedia disambiguation page")
end
Line 107:
function p:test__only_explicit__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_wikidata__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_wikidata__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Wikipedia|only=explicit}}', "Free
end
function p:test__only_wikidata__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Wikipedia|only=wikidata}}', "free multilingual online encyclopedia")
end
function p:test__only_explicit__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Example|only=explicit}}', "")
end
function p:test__only_wikidata__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Example|only=wikidata}}', "Wikimedia disambiguation page")
end
Line 141:
function p:test__prefer_explicit__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__prefer_wikidata__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__prefer_explicit__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__prefer_wikidata__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__prefer_explicit__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Wikipedia|prefer=explicit}}', "Free
end
function p:test__prefer_wikidata__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Wikipedia|prefer=wikidata}}', "free multilingual online encyclopedia")
end
function p:test__prefer_explicit__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Example|prefer=explicit}}', "Wikimedia disambiguation page")
end
function p:test__prefer_wikidata__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Example|prefer=wikidata}}', "Wikimedia disambiguation page")
end
--[[ conflicting params ]]
--[[ only=explicit and prefer=wikidata ]]
function p:test__conflicting__only_explicit__prefer_wikidata__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__conflicting__only_explicit__prefer_wikidata__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__conflicting__only_explicit__prefer_wikidata__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Wikipedia|only=explicit|prefer=wikidata}}', "Free
end
function p:test__conflicting__only_explicit__prefer_wikidata__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Example|only=explicit|prefer=wikidata}}', "")
end
Line 281 ⟶ 194:
function p:test__conflicting__only_wikidata__prefer_explicit__explicit_exists__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__conflicting__only_wikidata__prefer_explicit__explicit_does_not_exist__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__conflicting__only_wikidata__prefer_explicit__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Wikipedia|only=wikidata|prefer=explicit}}', "free multilingual online encyclopedia")
end
function p:test__conflicting__only_wikidata__prefer_explicit__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Example|only=wikidata|prefer=explicit}}', "Wikimedia disambiguation page")
end
Line 299 ⟶ 212:
function p:test__only_explicit__undefined()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__empty()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__none()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__numbered()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__complex()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__complex__numbered()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__numbered__empty()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__numbered__none()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__complex__empty()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__complex__none()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__complex__numbered__empty()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
function p:test__only_explicit__complex__numbered__none()
self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=
end
Line 349 ⟶ 262:
--function p:test__the_test()
-- self:preprocess_equals('{{#invoke:GetShortDescription|main|stringify=yes|name=Example}}', "test the test")
--end
|