Module:Annotated link/testcases: Difference between revisions

Content deleted Content added
so many derps
mixed language test
Line 200:
end
 
--[[ name and link_lang en ]]
-- lang tests are not examples of proper usage; we're just testing the functionality
 
--[[ name and link_lang ]]
 
function p:test__link_lang_en()
Line 208 ⟶ 206:
end
 
--[[ name, display and link_lang fr ]]
function p:test__link_lang_fr()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|link_lang=fr}}', '<span title="French-language text"><i lang="fr">[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]]</i></span>', { 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/no explicit short description|display=TestLa page de test de Fred|link_lang=fr}}', '<span title="French-language text"><i lang="fr">[[:User:Fred Gandt/sandbox/no explicit short description|TestLa page de test de Fred]]</i></span>', { nowiki = 1 })
end
 
--[[ name, display, quote and link_lang fr ]]
 
function p:test__quote__link_lang_frtest__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|User:FredLa Gandt/sandbox/nopage explicitde shorttest descriptionde Fred]]</i></span>"', { nowiki = 1 })
end
 
--[[ name, aka and aka_lang ja ]]
 
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"><ispan lang="ja">フレッドのテストページ</ispan></span>', { nowiki = 1 })
end
 
--[[ name, wedge and wedge_lang ga ]]
 
function p:test__wedge__wedge_lang_ga()
self:preprocess_equals('"{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|link_langwedge=fr}}',Leathanach '<spantástála titleFred|wedge_lang=ga}}"French-language, text"><i lang="fr">'[[: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>', { nowiki = 1 })
end
 
--[[ name, wedge and wedge_langmixed language ]]
 
function p:test__wedge__wedge_lang_jatest__mixed_language()
self:preprocess_equals("'{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|wedgedisplay=La page de test de Fred|link_lang=fr|aka=フレッドのテストページ|wedge_langaka_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|User:FredLa Gandt/sandbox/nopage explicitde shorttest descriptionde Fred]]</i></span>, also known as <span title="Japanese-language text"><ispan lang="ja">フレッドのテストページ</span></span>, <span title="Irish-language text"><i lang="ga">Leathanach tástála Fred</i></span>', { nowiki = 1 })
end