跳转到内容

Template:Tlg/testcases

维基百科,自由的百科全书
no parameters
{{…|Abc}}
  • {{Tlg|Abc}} → {{Abc}}
  • {{Tlg/sandbox|Abc}} → {{Abc}}
{{…|abC}}
  • {{Tlg|abC}} → {{abC}}
  • {{Tlg/sandbox|abC}} → {{abC}}
  • template names are case-sensitive
{{…|abc}}
  • {{Tlg|abc}} → {{abc}}
  • {{Tlg/sandbox|abc}} → {{abc}}
  • first letter is case-insensitive though
{{…|x0}}
  • {{Tlg|x0}} → {{x0}}
  • {{Tlg/sandbox|x0}} → {{x0}}
{{…|code=on|x0}}
  • {{Tlg|code=on|x0}}{{x0}}
  • {{Tlg/sandbox|code=on|x0}}{{x0}}
  • code style
{{…|plaincode=on|x0}}
  • {{Tlg|plaincode=on|x0}}{{x0}}
  • {{Tlg/sandbox|plaincode=on|x0}}{{x0}}
  • plaincode style
{{…|bold=on|x0}}
  • {{Tlg|bold=on|x0}} → {{x0}}
  • {{Tlg/sandbox|bold=on|x0}} → {{x0}}
  • bold style
{{…|boldlink=on|x0}}
  • {{Tlg|boldlink=on|x0}} → {{x0}}
  • {{Tlg/sandbox|boldlink=on|x0}} → {{x0}}
  • boldlink
{{…|linksize=130%|x0}}
  • {{Tlg|linksize=130%|x0}} → {{x0}}
  • {{Tlg/sandbox|linksize=130%|x0}} → {{x0}}
  • linksize
{{…|namesize=130%|x0}}
  • {{Tlg|namesize=130%|x0}} → {{x0}}
  • {{Tlg/sandbox|namesize=130%|x0}} → {{x0}}
  • namesize
{{…|x1|one|italic=on}}
  • {{Tlg|x1|one|italic=on}} → {{x1|one}}
  • {{Tlg/sandbox|x1|one|italic=on}} → {{x1|one}}
  • italic style
{{…|x1|one|italics=on}}
  • {{Tlg|x1|one|italics=on}} → {{x1|one}}
  • {{Tlg/sandbox|x1|one|italics=on}} → {{x1|one}}
{{…|x0|nolink=on}}
  • {{Tlg|x0|nolink=on}} → {{x0}}
  • {{Tlg/sandbox|x0|nolink=on}} → {{x0}}
{{…|x0|subst=on}}
  • {{Tlg|x0|subst=on}} → {{subst:x0}}
  • {{Tlg/sandbox|x0|subst=on}} → {{subst:x0}}
{{…|x0|brace=on}}
  • {{Tlg|x0|brace=on}}{{x0}}
  • {{Tlg/sandbox|x0|brace=on}}{{x0}}
{{…|x0|braceinside=on}}
  • {{Tlg|x0|braceinside=on}} → {{x0}}
  • {{Tlg/sandbox|x0|braceinside=on}} → {{x0}}
{{…|x0|alttext=x0 link}}
  • {{Tlg|x0|alttext=x0 link}} → {{x0 link}}
  • {{Tlg/sandbox|x0|alttext=x0 link}} → {{x0 link}}
{{…|x0|bold=on|code=on|brace=on}}
  • {{Tlg|x0|bold=on|code=on|brace=on}}{{x0}}
  • {{Tlg/sandbox|x0|bold=on|code=on|brace=on}}{{x0}}
  • No reason you can't combine multiple parameter setting
{{…|x1|one}}
  • {{Tlg|x1|one}} → {{x1|one}}
  • {{Tlg/sandbox|x1|one}} → {{x1|one}}
{{…|x2|one|two}}
  • {{Tlg|x2|one|two}} → {{x2|one|two}}
  • {{Tlg/sandbox|x2|one|two}} → {{x2|one|two}}
{{…|x2|bold=on|code=on|one|two}}
  • {{Tlg|x2|bold=on|code=on|one|two}}{{x2|one|two}}
  • {{Tlg/sandbox|x2|bold=on|code=on|one|two}}{{x2|one|two}}
  • Can combine named and anonymous parameters …
{{…|x2|one|two|bold=on|code=on}}
  • {{Tlg|x2|one|two|bold=on|code=on}}{{x2|one|two}}
  • {{Tlg/sandbox|x2|one|two|bold=on|code=on}}{{x2|one|two}}
  • … in any order …
{{…|x2|one|code=on|two|bold=on|three}}
  • {{Tlg|x2|one|code=on|two|bold=on|three}}{{x2|one|two|three}}
  • {{Tlg/sandbox|x2|one|code=on|two|bold=on|three}}{{x2|one|two|three}}
  • … even intermixed …
{{…|x2|one|code=on|two|bold=on|three|italic=on}}
  • {{Tlg|x2|one|code=on|two|bold=on|three|italic=on}}{{x2|one|two|three}}
  • {{Tlg/sandbox|x2|one|code=on|two|bold=on|three|italic=on}}{{x2|one|two|three}}
  • … with many different configurations.
{{…|x3|1|2|3|4|5|6|7|8|9|10}}
  • {{Tlg|x3|1|2|3|4|5|6|7|8|9|10}} → {{x3|1|2|3|4|5|6|7|8|9|10}}
  • {{Tlg/sandbox|x3|1|2|3|4|5|6|7|8|9|10}} → {{x3|1|2|3|4|5|6|7|8|9|10}}
{{…|x4|1|2|3|4|5|6|7|8|9|10|11}}
  • {{Tlg|x4|1|2|3|4|5|6|7|8|9|10|11}} → {{x4|1|2|3|4|5|6|7|8|9|10|11}}
  • {{Tlg/sandbox|x4|1|2|3|4|5|6|7|8|9|10|11}} → {{x4|1|2|3|4|5|6|7|8|9|10|11}}
  • up to 10 parameters, then …
{{…|x5|1|2|3|4|5|6|7|8|9|10|11}}
  • {{Tlg|x5|1|2|3|4|5|6|7|8|9|10|11}} → {{x5|1|2|3|4|5|6|7|8|9|10|11}}
  • {{Tlg/sandbox|x5|1|2|3|4|5|6|7|8|9|10|11}} → {{x5|1|2|3|4|5|6|7|8|9|10|11}}
  • | for more
{{…|x1|x=u}}
  • {{Tlg|x1|x=u}} → {{x1}}
  • {{Tlg/sandbox|x1|x=u}} → {{x1}}
  • "=" won't work
{{…|x1|x=u}}
  • {{Tlg|x1|x=u}} → {{x1|x=u}}
  • {{Tlg/sandbox|x1|x=u}} → {{x1|x=u}}
  • = is okay
{{…|x1|x{{=}}u}}
  • {{Tlg|x1|x{{=}}u}} → {{x1|x=u}}
  • {{Tlg/sandbox|x1|x{{=}}u}} → {{x1|x=u}}
  • {{=}} is okay
{{…|x1|x<nowiki>=</nowiki>u}}
  • {{Tlg|x1|x'"`UNIQ--nowiki-0000003E-QINU`"'u}} → {{x1|x=u}}
  • {{Tlg/sandbox|x1|x'"`UNIQ--nowiki-0000003E-QINU`"'u}} → {{x1|x=u}}
  • sticky nowiki is okay
{{…|x2|<nowiki />|two|<nowiki />|<nowiki />}}
  • {{Tlg|x2|'"`UNIQ--nowiki-00000040-QINU`"'|two|'"`UNIQ--nowiki-00000041-QINU`"'|'"`UNIQ--nowiki-00000042-QINU`"'}} → {{x2||two||}}
  • {{Tlg/sandbox|x2|'"`UNIQ--nowiki-00000040-QINU`"'|two|'"`UNIQ--nowiki-00000041-QINU`"'|'"`UNIQ--nowiki-00000042-QINU`"'}} → {{x2||two||}}
{{…|x2|<nowiki>2=one</nowiki>|two}}
  • {{Tlg|x2|'"`UNIQ--nowiki-00000044-QINU`"'|two}} → {{x2|2=one|two}}
  • {{Tlg/sandbox|x2|'"`UNIQ--nowiki-00000044-QINU`"'|two}} → {{x2|2=one|two}}
{{…|x2|<nowiki>3=two</nowiki>|<nowiki>2=one</nowiki>}}
  • {{Tlg|x2|'"`UNIQ--nowiki-00000046-QINU`"'|'"`UNIQ--nowiki-00000047-QINU`"'}} → {{x2|3=two|2=one}}
  • {{Tlg/sandbox|x2|'"`UNIQ--nowiki-00000046-QINU`"'|'"`UNIQ--nowiki-00000047-QINU`"'}} → {{x2|3=two|2=one}}
  • right to left okay

Show results

{{…|Min|_show_result=y}}
  • {{Tlg|Min|_show_result=y}} → {{Min}} →
  • {{Tlg/sandbox|Min|_show_result=y}} → {{Min}} →
  • Show results = empty value
{{…|Min|-7|_show_result=y}}
  • {{Tlg|Min|-7|_show_result=y}} → {{Min|-7}} → -7
  • {{Tlg/sandbox|Min|-7|_show_result=y}} → {{Min|-7}} → -7
  • Show results = -7
{{…|Min|1{{=}}-7|_show_result=y}}
  • {{Tlg|Min|1{{=}&#125;-7|_show_result=y}} → {{Tlg|Min|1{{=}}-7|_show_result=y}}
  • {{Tlg/sandbox|Min|1{{=}&#125;-7|_show_result=y}} → {{Tlg/sandbox|Min|1{{=}}-7|_show_result=y}}
  • Show results = -7
{{…|Min|7|-5|_show_result=y}}
  • {{Tlg|Min|7|-5|_show_result=y}} → {{Min|7|-5}} → -5
  • {{Tlg/sandbox|Min|7|-5|_show_result=y}} → {{Min|7|-5}} → -5
  • Show results = -5
{{…|Min|1{{=}}-7|2{{=}}-5|_show_result=y}}
  • {{Tlg|Min|1{{=}&#125;-7|2{{=}&#125;-5|_show_result=y}} → {{Tlg|Min|1{{=}}-7|2{{=}}-5|_show_result=y}}
  • {{Tlg/sandbox|Min|1{{=}&#125;-7|2{{=}&#125;-5|_show_result=y}} → {{Tlg/sandbox|Min|1{{=}}-7|2{{=}}-5|_show_result=y}}
  • Show results = -5
{{…|Min|-4|-6|0|_show_result=y|_expand=y}}
  • {{Tlg|Min|-4|-6|0|_show_result=y|_expand=y}} → {{Min|-4|-6|0}} → -6 [1]
  • {{Tlg/sandbox|Min|-4|-6|0|_show_result=y|_expand=y}} → {{Min|-4|-6|0}} → -6 [2]
  • Show results = -6; show template expand link
{{…|Min|1{{=}}-4|2{{=}}-6|3{{=}}0|_show_result=y|_expand=y}}
  • {{Tlg|Min|1{{=}&#125;-4|2{{=}&#125;-6|3{{=}}0|_show_result=y|_expand=y}} → {{Tlg|Min|1{{=}}-4|2{{=}}-6|3=0|_show_result=y|_expand=y}}
  • {{Tlg/sandbox|Min|1{{=}&#125;-4|2{{=}&#125;-6|3{{=}}0|_show_result=y|_expand=y}} → {{Tlg/sandbox|Min|1{{=}}-4|2{{=}}-6|3=0|_show_result=y|_expand=y}}
  • Show results = -6; show template expand link
{{…|ill|Charles Darwin (botanist)|text{{=}}Charles Darwin|fr|Charles Darwin|de|Charles Darwin|es|Charles Darwin|_show_result=y}}
  • {{Tlg|ill|Charles Darwin (botanist)|text{{=}}Charles Darwin|fr|Charles Darwin|de|Charles Darwin|es|Charles Darwin|_show_result=y}} → {{ill|Charles Darwin (botanist)|text=Charles Darwin|fr|Charles Darwin|de|Charles Darwin|es|Charles Darwin}} → Charles Darwin (botanist)​(法语;​德语;​西班牙语
  • {{Tlg/sandbox|ill|Charles Darwin (botanist)|text{{=}}Charles Darwin|fr|Charles Darwin|de|Charles Darwin|es|Charles Darwin|_show_result=y}} → {{ill|Charles Darwin (botanist)|text=Charles Darwin|fr|Charles Darwin|de|Charles Darwin|es|Charles Darwin}} → Charles Darwin (botanist)​(法语;​德语;​西班牙语
  • Mixed named positional parameters
{{…|Multiply|1,000|1,000|r{{=}}1|nosep{{=}}1|_show_result=yes|_expand=y}}
  • {{Tlg|Multiply|1,000|1,000|r{{=}}1|nosep{{=}}1|_show_result=yes|_expand=y}} → {{Multiply|1,000|1,000|r=1|nosep=1}} → × [3]
  • {{Tlg/sandbox|Multiply|1,000|1,000|r{{=}}1|nosep{{=}}1|_show_result=yes|_expand=y}} → {{Multiply|1,000|1,000|r=1|nosep=1}} → × [4]
  • Show results = 1000000; show template expand link; Mixed named positional parameters
{{…|Multiply|r{{=}}1|nosep{{=}}1|1,000|1,000|_show_result=yes|_expand=y}}
  • {{Tlg|Multiply|r{{=}}1|nosep{{=}}1|1,000|1,000|_show_result=yes|_expand=y}} → {{Multiply|r=1|nosep=1|1,000|1,000}} → × [5]
  • {{Tlg/sandbox|Multiply|r{{=}}1|nosep{{=}}1|1,000|1,000|_show_result=yes|_expand=y}} → {{Multiply|r=1|nosep=1|1,000|1,000}} → × [6]
  • Show results = 1000000; show template expand link; Mixed named positional parameters
{{…|Multiply|1,000|r{{=}}1|nosep{{=}}1|1,000|_show_result=yes|_expand=y}}
  • {{Tlg|Multiply|1,000|r{{=}}1|nosep{{=}}1|1,000|_show_result=yes|_expand=y}} → {{Multiply|1,000|r=1|nosep=1|1,000}} → × [7]
  • {{Tlg/sandbox|Multiply|1,000|r{{=}}1|nosep{{=}}1|1,000|_show_result=yes|_expand=y}} → {{Multiply|1,000|r=1|nosep=1|1,000}} → × [8]
  • Show results = 1000000; show template expand link; Mixed named positional parameters