Module:Annotated link/testcases: Difference between revisions

Content deleted Content added
test testing lang
name, quote and link_lang
Line 7:
 
function p:test__no_name_param()
self:preprocess_equals('{{#invoke:AnnotatedLink|main}}', '<strong class="error">ERROR with invocation of [[Module:AnnotatedLink]]: a page name (including namespace) MUST be provided</strong>', { nowiki = 1 })
end
 
function p:test__no_name_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=}}', '<strong class="error">ERROR with invocation of [[Module:AnnotatedLink]]: a page name (including namespace) MUST be provided</strong>', { nowiki = 1 })
end
 
Line 123:
 
function p:test__abbr__short_description_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|abbr=ESD}}', '[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] (<abbr>ESD</abbr>) – explicit short description', { nowiki = 1 })
end
 
function p:test__abbr__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|abbr=NESD}}', '[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]] (<abbr>NESD</abbr>)', { nowiki = 1 })
end
 
Line 133:
 
function p:test__abbr__abbr_title__short_description_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|abbr=ESD|abbr_title=Explicit Short Description}}', '[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] (<abbr title="Explicit Short Description">ESD</abbr>) – explicit short description', { nowiki = 1 })
end
 
function p:test__abbr__abbr_title__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|abbr=NESD|abbr_title=No Explicit Short Description}}', '[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]] (<abbr title="No Explicit Short Description">NESD</abbr>)', { nowiki = 1 })
end
 
Line 163:
 
function p:test__abbr__aka__short_description_exists()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|abbr=ESD|aka=Fred's test page}}", "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] (<abbr>ESD</abbr>), also known as Fred's test page – explicit short description", { nowiki = 1 })
end
 
function p:test__abbr__aka__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|abbr=NESD|aka=Fred's test page}}", "[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]] (<abbr>NESD</abbr>), also known as Fred's test page", { nowiki = 1 })
end
 
Line 173:
 
function p:test__abbr__wedge__short_description_exists()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|abbr=ESD|wedge=[[Tight Fit]]}}", "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] (<abbr>ESD</abbr>), [[Tight Fit]] – explicit short description", { nowiki = 1 })
end
 
function p:test__abbr__wedge__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|abbr=NESD|wedge=[[Tight Fit]]}}", "[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]] (<abbr>NESD</abbr>), [[Tight Fit]]", { nowiki = 1 })
end
 
Line 183:
 
function p:test__abbr__aka__wedge__short_description_exists()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|abbr=ESD|aka=Fred's test page|wedge=[[Tight Fit]]}}", "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] (<abbr>ESD</abbr>), also known as Fred's test page, [[Tight Fit]] – explicit short description", { nowiki = 1 })
end
 
function p:test__abbr__aka__wedge__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|abbr=NESD|aka=Fred's test page|wedge=[[Tight Fit]]}}", "[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]] (<abbr>NESD</abbr>), also known as Fred's test page, [[Tight Fit]]", { nowiki = 1 })
end
 
Line 210:
function p:test__link_lang_fr()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|link_lang=fr}}', '<span title="French-language text"><i lang="fr">[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]]</i></span> – explicit short description', { nowiki = 1 })
end
 
--[[ name, display and link_lang ]]
 
function p:test__display__link_lang_fr()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|display=Test page|link_lang=fr}}', '<span title="French-language text"><i lang="fr">[[:User:Fred Gandt/sandbox/explicit short description|Test page]]</i></span> – explicit short description', { nowiki = 1 })
end
 
--[[ name, quote and link_lang ]]
 
function p:test__quote__link_lang_fr()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|quote=yes|link_lang=fr}}', '"<span title="French-language text"><i lang="fr">[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]]</i></span>" – explicit short description', { nowiki = 1 })
end