Content deleted Content added
Fred Gandt (talk | contribs) mixed language test |
Fred Gandt (talk | contribs) I think that's everything within reason |
||
Line 236:
end
function p:test__dash_value_comma()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|dash=,}}', "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]], explicit short description")
end
function p:test__desc_first_letter_case_upper()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|desc_first_letter_case=upper}}', "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] – Explicit short description")
end
--[[ basic passthrough to Module:GetShortDescription ]]
--[[ only explicit ]]
function p:test__only_explicit__explicit_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|only=explicit}}', "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] – explicit short description")
end
function p:test__only_explicit__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|only=explicit}}', "[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]]")
end
--[[ only wikidata ]]
function p:test__only_wikidata__wikidata_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=Wikipedia|only=wikidata}}', "[[:Wikipedia|Wikipedia]] – free multilingual online encyclopedia")
end
function p:test__only_wikidata__wikidata_does_not_exist()
|desc_lang_italic= |desc_lang_nocat= |desc_lang_size= |desc_lang_cat= |desc_lang_rtl= |desc_lang_no=▼
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|only=wikidata}}', "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]]")
end
--[[ prefer explicit ]]
function p:test__only_explicit__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=Wikipedia|prefer=explicit}}', "[[:Wikipedia|Wikipedia]] – Free multilingual, online, crowdsourced encyclopedia")
end
function p:test__only_explicit__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=Example|prefer=explicit}}', "[[:Example|Example]] – Wikimedia disambiguation page")
end
--[[ prefer wikidata ]]
function p:test__only_wikidata__wikidata_exists__explicit_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=Wikipedia|prefer=wikidata}}', "[[:Wikipedia|Wikipedia]] – free multilingual online encyclopedia")
end
function p:test__only_wikidata__wikidata_does_not_exist__explicit_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|prefer=wikidata}}', "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] – explicit short description")
end
-- [[ fallback ]]
function p:test__only_explicit__fallback__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|only=explicit|fallback=fallback}}', "[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]] – fallback")
end
function p:test__only_wikidata__fallback__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|only=wikidata|fallback=fallback}}', "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] – fallback")
end
--[[ test the test; sanity check; should fail ]]
Line 259 ⟶ 301:
-- self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=Example}}', "test the test")
--end
--[[ foreign language wikidata ]]
▲-- Testing |desc_lang_italic= |desc_lang_nocat= |desc_lang_size= |desc_lang_cat= |desc_lang_rtl= |desc_lang_no= will require a wikidata description in a language other than English to be returned
return p
|