Module:Annotated link/testcases: Difference between revisions

Content deleted Content added
Undid revision 1135864279 by Fred Gandt (talk); did not fail
"test..."
Line 6:
--[[ empty params ]]
 
function p:no_name_paramtest__no_name_param()
self:preprocess_equals('{{#invoke:AnnotatedLink|main}}', "ERROR with invocation of Module:AnnotatedLink: a page name (including namespace) MUST be provided")
end
 
function p:no_name_valuetest__no_name_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=}}', "ERROR with invocation of Module:AnnotatedLink: a page name (including namespace) MUST be provided")
end
 
function p:no_display_valuetest__no_display_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|display=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_quote_valuetest__no_quote_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|quote=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_abbr_valuetest__no_abbr_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|abbr=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_abbr_value__abbr_titletest__no_abbr_value__abbr_title()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|abbr=|abbr_title=Abbreviation}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_abbr__no_abbr_title_valuetest__no_abbr__no_abbr_title_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|abbr=|abbr_title=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_aka_valuetest__no_aka_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|aka=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_wedge_valuetest__no_wedge_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|wedge=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_dash_valuetest__no_dash_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|dash=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_desc_first_letter_case_valuetest__no_desc_first_letter_case_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|desc_first_letter_case=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_link_lang_valuetest__no_link_lang_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|link_lang=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
Line 56:
-- tests for empty |link_lang_italic= |link_lang_nocat= |link_lang_size= |link_lang_cat= |link_lang_rtl= ?
 
function p:no_aka_lang_valuetest__no_aka_lang_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|aka_lang=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
Line 62:
-- tests for empty |aka_lang_italic= |aka_lang_nocat= |aka_lang_size= |aka_lang_cat= |aka_lang_rtl= ?
 
function p:no_wedge_lang_valuetest__no_wedge_lang_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|wedge_lang=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
Line 68:
-- tests for empty |wedge_lang_italic= |wedge_lang_nocat= |wedge_lang_size= |wedge_lang_cat= |wedge_lang_rtl= ?
 
function p:no_only_valuetest__no_only_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|only=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_prefer_valuetest__no_prefer_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|prefer=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:no_fallback_valuetest__no_fallback_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|fallback=}}', "User:Fred Gandt/sandbox/no explicit short description")
end
Line 82:
--[[ unknown param ]]
 
function p:no_unknown_valuetest__no_unknown_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|unknown=}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:unknown_valuetest__unknown_value()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|unknown=unknown}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
Line 92:
--[[ none but name ]]
 
function p:short_description_existstest__short_description_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description}}', "User:Fred Gandt/sandbox/explicit short description – explicit short description")
end
 
function p:short_description_does_not_existtest__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description}}', "User:Fred Gandt/sandbox/no explicit short description")
end
Line 102:
--[[ name and display ]]
 
function p:display__short_description_existstest__display__short_description_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|display=Test page}}', "Test page – explicit short description")
end
 
function p:display__short_description_does_not_existtest__display__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|display=Test page}}', "Test page")
end
Line 112:
--[[ name and quote ]]
 
function p:quote__short_description_existstest__quote__short_description_exists()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|quote=yes}}', '"User:Fred Gandt/sandbox/explicit short description" – explicit short description')
end
 
function p:quote__short_description_does_not_existtest__quote__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|quote=yes}}', '"User:Fred Gandt/sandbox/no explicit short description"')
end
Line 122:
--[[ name and abbr ]]
 
function p:abbr__short_description_existstest__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 (ESD) – explicit short description')
end
 
function p:abbr__short_description_does_not_existtest__abbr__short_description_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|abbr=ESD}}', 'User:Fred Gandt/sandbox/no explicit short description (NESD)')
end
Line 132:
--[[ name and aka ]]
 
function p:aka__short_description_existstest__aka__short_description_exists()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|aka=Fred's test page}}", "User:Fred Gandt/sandbox/explicit short description, also known as Fred's test page – explicit short description")
end
 
function p:aka__short_description_does_not_existtest__aka__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|aka=Fred's test page}}", "User:Fred Gandt/sandbox/no explicit short description, also known as Fred's test page")
end
Line 142:
--[[ name and wedge ]]
 
function p:wedge__short_description_existstest__wedge__short_description_exists()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|wedge=[[Tight Fit]]}}", "User:Fred Gandt/sandbox/explicit short description, Tight Fit – explicit short description")
end
 
function p:wedge__short_description_does_not_existtest__wedge__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|wedge=[[Tight Fit]]}}", "User:Fred Gandt/sandbox/no explicit short description, Tight Fit")
end
Line 152:
--[[ name, abbr and aka ]]
 
function p:abbr__aka__short_description_existstest__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 (ESD), also known as Fred's test page – explicit short description")
end
 
function p:abbr__aka__short_description_does_not_existtest__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 (NESD), also known as Fred's test page")
end
Line 162:
--[[ name, abbr and wedge ]]
 
function p:abbr__wedge__short_description_existstest__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 (ESD), Tight Fit – explicit short description")
end
 
function p:abbr__wedge__short_description_does_not_existtest__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 (NESD), Tight Fit")
end
Line 172:
--[[ name, abbr, aka and wedge ]]
 
function p:abbr__aka__wedge__short_description_existstest__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 (ESD), also known as Fred's test page, Tight Fit – explicit short description")
end
 
function p:test__abbr__aka__wedge__short_description_does_not_exist()
function p: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 (NESD), also known as Fred's test page, Tight Fit")
end
Line 182:
--[[ name, aka and wedge ]]
 
function p:aka__wedge__short_description_existstest__aka__wedge__short_description_exists()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|aka=Fred's test page|wedge=[[Tight Fit]]}}", "User:Fred Gandt/sandbox/explicit short description, also known as Fred's test page, Tight Fit – explicit short description")
end
 
function p:aka__wedge__short_description_does_not_existtest__aka__wedge__short_description_does_not_exist()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|aka=Fred's test page|wedge=[[Tight Fit]]}}", "User:Fred Gandt/sandbox/no explicit short description, also known as Fred's test page, Tight Fit")
end