词条 | Module:Template test case/testcases |
释义 | -- Unit tests for Template test case. Click talk page to run tests. local p = require('Module:UnitTests') function p:test01_columns() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=columns |_caption=_caption |_rowheader=_rowheader |_heading0=_heading0 |_heading1=_heading1 |_heading2=_heading2 |_heading3=_heading3 |_before=_before |_after=_after |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', '{{#invoke:Template test case |main |_format=columns |_caption=_caption |_rowheader=_rowheader |_heading0=_heading0 |_heading1=_heading1 |_heading2=_heading2 |_heading3=_heading3 |_before=_before |_after=_after |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}' ) end function p:test01_columns_nowiki() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=columns |_caption=_caption |_rowheader=_rowheader |_heading0=_heading0 |_heading1=_heading1 |_heading2=_heading2 |_heading3=_heading3 |_before=_before |_after=_after |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', '{{#invoke:Template test case |main |_format=columns |_caption=_caption |_rowheader=_rowheader |_heading0=_heading0 |_heading1=_heading1 |_heading2=_heading2 |_heading3=_heading3 |_before=_before |_after=_after |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', {nowiki=1} ) end function p:test02_showheader() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=columns |_showheader=no |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', '{{#invoke:Template test case |main |_format=columns |_showheader=no |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}' ) end function p:test02_showheader_nowiki() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=columns |_showheader=no |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', '{{#invoke:Template test case |main |_format=columns |_showheader=no |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', {nowiki=1} ) end function p:test03_caption() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=columns |_caption= |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', '{{#invoke:Template test case |main |_format=columns |_caption= |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}' ) end function p:test03_caption_nowiki() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=columns |_caption= |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', '{{#invoke:Template test case |main |_format=columns |_caption= |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', {nowiki=1} ) end function p:test04_showcaption() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=columns |_showcaption=no |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', '{{#invoke:Template test case |main |_format=columns |_showcaption=no |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}' ) end function p:test04_showcaption_nowiki() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=columns |_showcaption=no |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', '{{#invoke:Template test case |main |_format=columns |_showcaption=no |_template1=Commons-inline |_template2=Commons category-inline |_template3=Commons and category-inline |Lorem ipsum|Lorem ipsum}}', {nowiki=1} ) end function p:test05_addline() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=inline |_showcode=yes |_template1=Height |m=1.51 |_addline=Output of Convert template: {{Cvt|1.51|m|frac=2}} }}', '{{#invoke:Template test case |main |_format=inline |_showcode=yes |_template1=Height |m=1.51 |_addline=Output of Convert template: {{Cvt|1.51|m|frac=2}} }}' ) end function p:test05_addline_nowiki() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=inline |_showcode=yes |_template1=Height |m=1.51 |_addline=Output of Convert template: {{Cvt|1.51|m|frac=2}} }}', '{{#invoke:Template test case |main |_format=inline |_showcode=yes |_template1=Height |m=1.51 |_addline=Output of Convert template: {{Cvt|1.51|m|frac=2}} }}', {nowiki=1} ) end function p:test06_output() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_output=nowiki |_format=inline |_showcode=yes |_template1=Height |m=1.51}}', '{{#invoke:Template test case |main |_output=nowiki |_format=inline |_showcode=yes |_template1=Height |m=1.51}}' ) end function p:test07_output() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_output=nowiki+ |_format=inline |_showcode=yes |_template1=Height |m=1.51}}', '{{#invoke:Template test case |main |_output=nowiki+ |_format=inline |_showcode=yes |_template1=Height |m=1.51}}' ) end function p:test08_prefix() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=inline |_prefix=# |_showcode=yes |_template1=Height |m=1.51}}', '{{#invoke:Template test case |main |_format=inline |_prefix=# |_showcode=yes |_template1=Height |m=1.51}}' ) end function p:test09_prefix() self:preprocess_equals_preprocess( '{{#invoke:Template test case/sandbox |main |_format=inline |_prefix=: |_template1=Height |m=1.51}}', '{{#invoke:Template test case |main |_format=inline |_prefix=: |_template1=Height |m=1.51}}' ) end return p |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。