Template:Section link/testcases
{{template test cases notice}}
class="wikitable" |
Lua code
! Wikitext code ! Result |
---|
rowspan="2"|{{code|mSectionLink('Paris','Architecture')|lua}}
| | {{section link|Paris|Architecture}} |
| {{section link/sandbox|Paris|Architecture}} |
rowspan="2"|{{code|mSectionLink('Paris',{'Architecture','Culture'})|lua}}
| | {{section link|Paris|Architecture|Culture}} |
| {{section link/sandbox|Paris|Architecture|Culture}} |
rowspan="2"|{{code|mSectionLink('Paris',{'Architecture','Culture','Sport'})|lua}}
| | {{section link|Paris|Architecture|Culture|Sport}} |
| {{section link/sandbox|Paris|Architecture|Culture|Sport}} |
rowspan="2"|{{code|1=mSectionLink('Paris',{'Architecture','Culture','Sport'},{nopage=true})|2=lua}}
| | {{section link|Paris|Architecture|Culture|Sport|nopage=yes}} |
| {{section link/sandbox|Paris|Architecture|Culture|Sport|nopage=yes}} |
{{collapsible test case|_showcode=yes|_title=Case 1: no parameters}}
{{collapsible test case|_showcode=yes|_title=Case 2: only one parameter|Section}}
{{collapsible test case|_showcode=yes|_title=Case 3: article and section|Article|Section}}
{{collapsible test case|_showcode=yes|_title=Case 4a: only section (Null article parameter)||Section}}
{{collapsible test case|_showcode=yes|_title=Case 4b: only section (No article parameter at all)|2=Section}}
{{collapsible test case|_showcode=yes|_title=Case 4c: only section (No article parameter at all and nopage set)|2=Section|nopage=yes}}
{{collapsible test case|_showcode=yes|_title=Case 5: article and 2 sections|Article|Section 1|Section 2}}
{{collapsible test case|_showcode=yes|_title=Case 6: article and 3 sections|Article|Section 1|Section 2|Section 3}}
{{collapsible test case|_showcode=yes|_title=Case 7: article and 4 sections|Article|Section 1|Section 2|Section 3|Section 4}}
{{collapsible test case|_showcode=yes|_title=Case 8: article and 5 sections|Article|Section 1|Section 2|Section 3|Section 4|Section 5}}
{{collapsible test case|_showcode=yes|_title=Case 9a: 5 sections only (null article parameter)||Section 1|Section 2|Section 3||Section 5}}
{{collapsible test case|_showcode=yes|_title=Case 9b: 5 sections only (no article parameter and 5th positional parameter)|2=Section 1|3=Section 2|4=Section 3|6=Section 5}}
{{collapsible test case|_showcode=yes|_title=Case 9c: 5 sections only (no article parameter, 5th positional parameter, and nopage set)|2=Section 1|3=Section 2|4=Section 3|6=Section 5|nopage=yes}}
{{collapsible test case|_showcode=yes|_title=Case 10 (misuse): only positional parameters 3, 4 and 6|||Section 2|Section 3||Section 5}}
{{collapsible test case|_showcode=yes|_title=Case 11 (misuse): only positional parameters 4 and 6||||Section 3||Section 5}}
{{collapsible test case|_showcode=yes|_title=Case 12: subpage links|../|Usage}}
{{collapsible test case|_showcode=yes|_title=Case 13: display title|Wikipedia:Page name|Section|display=:wikipedia: _ page_name}}
{{collapsible test case|_showcode=yes|_title=Case 14: non-matching display title|Wikipedia:Page name|Section|display=WP:PNAME}}
{{collapsible test case|_showcode=yes|_title=Case 15: anchor in title|Article#Section}}
{{collapsible test case|_showcode=yes|_title=Case 16: anchor in title and section|Article#Section 1|Section 2}}
{{collapsible test case|_showcode=yes|_title=Case 17: multiple sections plus display title|Article|Section 1|Section 2|display=Article}}