Module:Lang/testcases: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 5:
--[[ -------------------------- < I T A L I C > --------------------------
 
Tests module parameter |italic= with values:
- 'yes',
- 'no',
- 'invert',
- 'italic',
- present but not set, and the
- invalid 'whatever'.,
There is a separate test for the- parameter not present.
 
|italic=yes or |italic=no overrides every other parameter that might set the rendered text's font.
Line 17 ⟶ 23:
{'yes'},
{'no'},
{'invert'},
{'italic'},
{''},
{'whatever'},
Line 95 ⟶ 103:
{'ru-Cyrl-RU'}, -- code-script-region
{'ca-419-valencia'}, -- code-numeric reigion-variant
}, {nowiki=1})
end
 
 
--[[ -------------------------- < I N V E R T _ I T A L I C S > --------------------------
 
Tests text ouput with |italic=invert set.
 
]]
 
function p:test_05_lang_invert_italics()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang|code=ar', '}}', '{{#invoke:Lang|lang|code=ar', '}}',
{
{'|text=text|italic=invert'},
{"|text=''text''|italic=invert"},
{"|text='''''text'''''|italic=invert"},
{"|text='''text'''|italic=invert"},
{"|text=''text's''|italic=invert"},
{"|text=text's|italic=invert"},
}, {nowiki=1})
end
Line 103 ⟶ 130:
--[[ -------------------------- < I T A L I C > --------------------------
 
- 'yes',
Tests module parameter |italic= with values 'yes', 'no', present but not set, and the invalid 'whatever'.
- 'no',
There is a separate test for the parameter not present.
- 'invert',
- 'italic',
- present but not set,
- invalid 'whatever',
There is a separate test for the- parameter not present.
 
 
|italic=yes or |italic=no overrides every other parameter that might set the rendered text's font.
Line 110 ⟶ 143:
]]
 
function p:test_05_lang_xx_italictest_06_lang_xx_italic()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang_xx_inherit|code=ar|text=text|italic=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|italic=', '}}',
{
{'yes'},
{'no'},
{'invert'},
{'italic'},
{''},
{'whatever'},
Line 134 ⟶ 169:
]]
 
function p:test_06_lang_xx_italic_with_scripttest_07_lang_xx_italic_with_script()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang_xx_inherit|code=ar|text=text|italic=yes|script=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|italic=yes|script=', '}}',
{
Line 163 ⟶ 198:
]]
 
function p:test_07_lang_xx_scripttest_08_lang_xx_script()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang_xx_inherit|code=ar|text=text|italic=|script=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|italic=|script=', '}}',
{
Line 186 ⟶ 221:
]]
 
function p:test_08_lang_xx_rtltest_09_lang_xx_rtl()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang_xx_inherit|code=ar|text=text|rtl=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|rtl=', '}}',
{
Line 205 ⟶ 240:
]]
 
function p:test_09_lang_xx_translittest_10_lang_xx_translit()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang_xx_inherit|nocat=yes|', '}}', '{{#invoke:Lang|lang_xx_inherit|nocat=yes|', '}}',
{
Line 221 ⟶ 256:
{'code=ff|text=𞤁𞤢𞤲𞤣𞤢𞤴𞤯𞤫|translit=something|translit-script=Adlm|translit-std=ALA'},
{'code=ar|text=نص العنصر النائب|translit=nasu aleunsur alnnay|translit-std=DIN|translit-script=arab'},
}, {nowiki=1})
end
 
 
--[[ -------------------------- < I N V E R T _ I T A L I C S > --------------------------
 
Tests text ouput with |italic=invert set.
 
]]
 
function p:test_11_lang_xx_invert_italics()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang_xx_inherit|code=ar', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar', '}}',
{
{'|text=text|italic=invert'},
{"|text=''text''|italic=invert"},
{"|text='''''text'''''|italic=invert"},
{"|text='''text'''|italic=invert"},
{"|text=''text's''|italic=invert"},
{"|text=text's|italic=invert"},
}, {nowiki=1})
end
Line 233 ⟶ 287:
]]
 
function p:test_10_transl_formatstest_12_transl_formats()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|transl|nocat=yes|', '}}', '{{#invoke:Lang|transl|nocat=yes|', '}}',
{
Line 263 ⟶ 317:
]]
 
function p:test_11_transl_italicstest_13_transl_italics()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|transl|nocat=yes|', '}}', '{{#invoke:Lang|transl|nocat=yes|', '}}',
{
Line 285 ⟶ 339:
]]
 
function p:test_12_lang_errorstest_14_lang_errors()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang|nocat=yes|', '}}', '{{#invoke:Lang|lang|nocat=yes|', '}}',
{
Line 311 ⟶ 365:
 
 
function p:test_13_lang_xx_errorstest_15_lang_xx_errors()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|lang_xx_inherit|nocat=yes|', '}}', '{{#invoke:Lang|lang_xx_inherit|nocat=yes|', '}}',
{
Line 344 ⟶ 398:
]]
 
function p:test_14_transl_errorstest_16_transl_errors()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|transl|nocat=yes|', '}}', '{{#invoke:Lang|transl|nocat=yes|', '}}',
{
Line 369 ⟶ 423:
]]
 
function p:test_15_name_from_tag_errorstest_17_name_from_tag_errors()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|name_from_tag|nocat=yes|', '}}', '{{#invoke:Lang|name_from_tag|nocat=yes|', '}}',
{
Line 390 ⟶ 444:
]]
 
function p:test_16_tag_from_name_errorstest_18_tag_from_name_errors()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|tag_from_name|nocat=yes|', '}}', '{{#invoke:Lang|tag_from_name|nocat=yes|', '}}',
{
Line 411 ⟶ 465:
]]
 
function p:test_17_category_from_tag_errorstest_19_category_from_tag_errors()
self:preprocess_equals_preprocess_many('{{#invoke:Lang/sandbox|category_from_tag|nocat=yes|', '}}', '{{#invoke:Lang|category_from_tag|nocat=yes|', '}}',
{