Module:Annotated link/testcases: Difference between revisions

Content deleted Content added
I just realised I made all my test short descs with lowercase first chars *facepalm*
use new "combined" option; thanks to User:Aidan9382
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>', { nowikicombined = 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>', { nowikicombined = 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', { nowikicombined = 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>)', { nowikicombined = 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', { nowikicombined = 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>)', { nowikicombined = 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", { nowikicombined = 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", { nowikicombined = 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", { nowikicombined = 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]]", { nowikicombined = 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", { nowikicombined = 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]]", { nowikicombined = 1 })
end
 
Line 209:
 
function p:test__display__link_lang_fr()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|display=La page de test de Fred|link_lang=fr}}', '<span title="French-language text"><i lang="fr">[[:User:Fred Gandt/sandbox/no explicit short description|La page de test de Fred]]</i></span>', { nowikicombined = 1 })
end
 
Line 215:
 
function p:test__display__quote__link_lang_fr()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|display=La page de test de Fred|quote=yes|link_lang=fr}}', '"<span title="French-language text"><i lang="fr">[[:User:Fred Gandt/sandbox/no explicit short description|La page de test de Fred]]</i></span>"', { nowikicombined = 1 })
end
 
Line 221:
 
function p:test__aka__aka_lang_ja()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|aka=フレッドのテストページ|aka_lang=ja}}", '[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]], also known as <span title="Japanese-language text"><span lang="ja">フレッドのテストページ</span></span>', { nowikicombined = 1 })
end
 
Line 227:
 
function p:test__wedge__wedge_lang_ga()
self:preprocess_equals("{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|wedge=Leathanach tástála Fred|wedge_lang=ga}}", '[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]], <span title="Irish-language text"><i lang="ga">Leathanach tástála Fred</i></span>', { nowikicombined = 1 })
end
 
Line 233:
 
function p:test__mixed_language()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/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">[[:User:Fred Gandt/sandbox/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>', { nowikicombined = 1 })
end