Module:Annotated link/testcases: Difference between revisions

Content deleted Content added
+ nowiki for and corrected category output
last fix(?)
 
(9 intermediate revisions by 2 users not shown)
Line 7:
 
function p:test__no_name_param()
self:preprocess_equals('{{#invoke:Annotated link|main}}', '<span style="color:#d33">[[Module:Annotated link]] requires a page name (including namespace).</span>[[Category:Pages displaying alarming messages about Module:AnnotatedLinkAnnotated link]]', { nowiki = 1 })
end
 
function p:test__no_name_value()
self:preprocess_equals('{{#invoke:Annotated link|main|name=}}', '<span style="color:#d33">[[Module:Annotated link]] requires a page name (including namespace).</span>[[Category:Pages displaying alarming messages about Module:AnnotatedLinkAnnotated link]]', { nowiki = 1 })
end
 
function p:test__no_display_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|display=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_quote_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|quote=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_abbr_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|abbr=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_abbr_value__abbr_title()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|abbr=|abbr_title=Abbreviation}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_abbr__no_abbr_title_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|abbr=|abbr_title=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_aka_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|aka=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_wedge_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|wedge=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_dash_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|dash=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_desc_first_letter_case_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|desc_first_letter_case=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_link_lang_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|link_lang=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
Line 57:
 
function p:test__no_aka_lang_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|aka_lang=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
Line 63:
 
function p:test__no_wedge_lang_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|wedge_lang=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
Line 69:
 
function p:test__no_only_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|only=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_prefer_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|prefer=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__no_fallback_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|fallback=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]]")
end
 
--[[ nonexistent page name ]]
 
function p:test__nonexistent_page_name()
self:preprocess_equals('{{#invoke:Annotated link|main|name=Intentionally permanent red link}}', '[[:Intentionally permanent red link|Intentionally permanent red link]]')
end
 
Line 83 ⟶ 89:
 
function p:test__no_unknown_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|unknown=}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__unknown_value()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|unknown=unknown}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
Line 93 ⟶ 99:
 
function p:test__short_description_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]]")
end
 
Line 107 ⟶ 113:
 
function p:test__template_link_code__only_explicit()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=code|name=Template:annotated link|template_link=code|only=explicit}}', "<code>{{[[:Template:annotated link|annotated link]]}}</code>", {combine = 1})
end
 
function p:test__template_link_no__only_explicit()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=Template:Annotated link|template_link=no|only=explicit}}', "[[:Template:Annotated link|Template:Annotated link]]")
end
 
function p:test__template_link_no__display__only_explicit()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=Template:Annotated link|template_link=no||display=Annotated link|only=explicit}}', "[[:Template:Annotated link|Annotated link]]")
end
 
Line 121 ⟶ 127:
 
function p:test__display__short_description_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|display=Test page}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|Test page]]&nbsp;– Explicit short description")
end
 
function p:test__display__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|display=Test page}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|Test page]]")
end
 
Line 131 ⟶ 137:
 
function p:test__quote__short_description_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|quote=yes}}', '"[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]"&nbsp;– Explicit short description')
end
 
function p:test__quote__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|quote=yes}}', '"[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]]"')
end
 
Line 141 ⟶ 147:
 
function p:test__abbr__short_description_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|abbr=ESD}}', '[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]] (<abbr>ESD</abbr>)&nbsp;– Explicit short description', { combined = 1 })
end
 
function p:test__abbr__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|abbr=NESD}}', '[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]] (<abbr>NESD</abbr>)', { combined = 1 })
end
 
Line 151 ⟶ 157:
 
function p:test__abbr__abbr_title__short_description_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|abbr=ESD|abbr_title=Explicit Short Description}}', '[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]] (<abbr title="Explicit Short Description">ESD</abbr>)&nbsp;– Explicit short description', { combined = 1 })
end
 
function p:test__abbr__abbr_title__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|abbr=NESD|abbr_title=No Explicit Short Description}}', '[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]] (<abbr title="No Explicit Short Description">NESD</abbr>)', { combined = 1 })
end
 
Line 161 ⟶ 167:
 
function p:test__aka__short_description_exists()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|aka=Fred's test page}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]], also known as Fred's test page&nbsp;– Explicit short description")
end
 
function p:test__aka__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|aka=Fred's test page}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]], also known as Fred's test page")
end
 
Line 171 ⟶ 177:
 
function p:test__wedge__short_description_exists()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|wedge=[[Tight Fit]]}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]], [[Tight Fit]]&nbsp;– Explicit short description")
end
 
function p:test__wedge__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|wedge=[[Tight Fit]]}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]], [[Tight Fit]]")
end
 
Line 181 ⟶ 187:
 
function p:test__abbr__aka__short_description_exists()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|abbr=ESD|aka=Fred's test page}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]] (<abbr>ESD</abbr>), also known as Fred's test page&nbsp;– Explicit short description", { combined = 1 })
end
 
function p:test__abbr__aka__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|abbr=NESD|aka=Fred's test page}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]] (<abbr>NESD</abbr>), also known as Fred's test page", { combined = 1 })
end
 
Line 191 ⟶ 197:
 
function p:test__abbr__wedge__short_description_exists()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|abbr=ESD|wedge=[[Tight Fit]]}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]] (<abbr>ESD</abbr>), [[Tight Fit]]&nbsp;– Explicit short description", { combined = 1 })
end
 
function p:test__abbr__wedge__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|abbr=NESD|wedge=[[Tight Fit]]}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]] (<abbr>NESD</abbr>), [[Tight Fit]]", { combined = 1 })
end
 
Line 201 ⟶ 207:
 
function p:test__abbr__aka__wedge__short_description_exists()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|abbr=ESD|aka=Fred's test page|wedge=[[Tight Fit]]}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]] (<abbr>ESD</abbr>), also known as Fred's test page, [[Tight Fit]]&nbsp;– Explicit short description", { combined = 1 })
end
 
function p:test__abbr__aka__wedge__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|abbr=NESD|aka=Fred's test page|wedge=[[Tight Fit]]}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]] (<abbr>NESD</abbr>), also known as Fred's test page, [[Tight Fit]]", { combined = 1 })
end
 
Line 211 ⟶ 217:
 
function p:test__aka__wedge__short_description_exists()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|aka=Fred's test page|wedge=[[Tight Fit]]}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]], also known as Fred's test page, [[Tight Fit]]&nbsp;– Explicit short description")
end
 
function p:test__aka__wedge__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|aka=Fred's test page|wedge=[[Tight Fit]]}}", "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]], also known as Fred's test page, [[Tight Fit]]")
end
 
Line 221 ⟶ 227:
 
function p:test__link_lang_en()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|link_lang=en}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]]")
end
 
Line 227 ⟶ 233:
 
function p:test__display__link_lang_fr()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|display=La page de test de Fred|link_lang=fr}}', '<span title="French-language text"><i lang="fr">[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|La page de test de Fred]]</i></span>', { combined = 1 })
end
 
Line 233 ⟶ 239:
 
function p:test__display__quote__link_lang_fr()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|display=La page de test de Fred|quote=yes|link_lang=fr}}', '"<span title="French-language text"><i lang="fr">[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|La page de test de Fred]]</i></span>"', { combined = 1 })
end
 
Line 239 ⟶ 245:
 
function p:test__aka__aka_lang_ja()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|aka=フレッドのテストページ|aka_lang=ja}}", '[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]], also known as <span title="Japanese-language text"><span lang="ja">フレッドのテストページ</span></span>', { combined = 1 })
end
 
Line 245 ⟶ 251:
 
function p:test__wedge__wedge_lang_ga()
self:preprocess_equals("{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|wedge=Leathanach tástála Fred|wedge_lang=ga}}", '[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]], <span title="Irish-language text"><i lang="ga">Leathanach tástála Fred</i></span>', { combined = 1 })
end
 
Line 251 ⟶ 257:
 
function p:test__mixed_language()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|display=La page de test de Fred|link_lang=fr|aka=フレッドのテストページ|aka_lang=ja|wedge=Leathanach tástála Fred|wedge_lang=ga}}', '<span title="French-language text"><i lang="fr">[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|La page de test de Fred]]</i></span>, also known as <span title="Japanese-language text"><span lang="ja">フレッドのテストページ</span></span>, <span title="Irish-language text"><i lang="ga">Leathanach tástála Fred</i></span>', { combined = 1 })
end
 
function p:test__dash_value_comma()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|dash=,}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]], Explicit short description")
end
 
function p:test__desc_first_letter_case_upper()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|desc_first_letter_case=upper}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
Line 265 ⟶ 271:
 
function p:test__categorise_no_space_descriptions()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description with no spaces}}', "'[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description with no spaces|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description with no spaces]]&nbsp;– Spacelessness<span style="display:none" class="category-spaceless-annotation">Pages displaying short descriptions with no spaces</span>[[Category:Pages displaying short descriptions with no spaces via Module:AnnotatedLinkAnnotated link]]"', {nowiki = 1})
end
 
function p:test__categorise_no_space_descriptions__space_cat()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description with no spaces|space_cat=meow}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description with no spaces|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description with no spaces]]&nbsp;– Spacelessness")
end
 
Line 277 ⟶ 283:
 
function p:test__only_explicit__explicit_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|only=explicit}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
function p:test__only_explicit__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|only=explicit}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]]")
end
 
Line 291 ⟶ 297:
 
function p:test__only_wikidata__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|only=wikidata}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]")
end
 
Line 297 ⟶ 303:
 
function p:test__only_explicit__explicit_exists__wikidata_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|name=Wikipedia|prefer=explicit}}', "[[:Wikipedia|Wikipedia]]&nbsp;– Free multilingual, online, crowdsourced encyclopedia")
end
 
function p:test__only_explicit__explicit_does_not_exist__wikidata_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|name=Example|prefer=explicit}}', '[[:Example|Example]]&nbsp;– Wikimedia disambiguation page<span style="display:none" class="category-wikidata-fallback-annotation">Pages displaying wikidata descriptions as a fallback via Module:Annotated link</span>[[Category:Pages displaying wikidata descriptions as a fallback via Module:Annotated link]]', {nowiki = 1})
end
 
Line 311 ⟶ 317:
 
function p:test__only_wikidata__wikidata_does_not_exist__explicit_exists()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|prefer=wikidata}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– Explicit short description")
end
 
Line 317 ⟶ 323:
 
function p:test__only_explicit__fallback__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|only=explicit|fallback=this is a fallback}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/no explicit short description]]&nbsp;– this is a fallback")
end
 
function p:test__only_wikidata__fallback__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:Annotated link|main|template_link=no|name=UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|only=wikidata|fallback=this is a fallback}}', "[[:UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description|UserTemplate:Fred Gandt/sandboxGetShortDescription/explicit short description]]&nbsp;– this is a fallback")
end
 
-- [[ prefix_parentheses ]]
 
function p:test__prefix_parentheses()
self:preprocess_equals('{{#invoke:Annotated_link|main|name=Jimmy Wales|dash=,|prefix_parentheses=y|desc_first_letter_case=lower}}', "[[:Jimmy Wales|Jimmy Wales]] (born 1966), co-founder of Wikipedia")
self:preprocess_equals('{{#invoke:Annotated_link|main|name=Jimmy Wales|dash=,|desc_first_letter_case=lower}}', "[[:Jimmy Wales|Jimmy Wales]], co-founder of Wikipedia (born 1966)")
end