fbpx
Wikipedia

Módulo:Lang/tests

local p = require('Módulo:UnitTests')  --[[ ========================== < L A N G _ T E S T S > ========================== ]]  --[[ -------------------------- < I T A L I C > --------------------------  Tests module parameter |italic= with values: - 'yes', - 'no', - 'invert', - 'italic', - present but not set, - invalid 'whatever', - parameter not present.  |italic=yes or |italic=no overrides every other parameter that might set the rendered text's font.  ]]  function p:test_01_lang_italic()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang|code=ar|text=text|italic=', '}}', '{{#invoke:Lang|lang|code=ar|text=text|italic=', '}}',  {  {'yes'},  {'no'},  {'invert'},  {'italic'},  {''},  {'whatever'},  }, {nowiki=1})  self:preprocess_equals_preprocess('{{#invoke:Lang/zona de pruebas|lang|code=ar|text=text}}', '{{#invoke:Lang|lang|code=ar|text=text}}',  {nowiki=1}) end   --[[ -------------------------- < I T A L I C _ W I T H _ S C R I P T > --------------------------  Tests module parameter |italic=yes and |italic=no when |script=arab or |script=latn is set.  |italic=yes should override whatever |script= might say.  The value assigned to |script= shall be appended to the language code; for |script=arab the module shall add dir="rtl" to the text's enclosing <span> and insert the &lrm; marker.  ]]  function p:test_02_lang_italic_with_script()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang|code=ar|text=text|italic=yes|script=', '}}', '{{#invoke:Lang|lang|code=ar|text=text|italic=yes|script=', '}}',  {  {'arab'},  {'latn'},  }, {nowiki=1})  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang|code=ar|text=text|italic=no|script=', '}}', '{{#invoke:Lang|lang|code=ar|text=text|italic=no|script=', '}}',  {  {'arab'},  {'latn'},  }, {nowiki=1}) end   --[[ -------------------------- < R T L > --------------------------  Tests module parameter |rtl= with values 'yes', 'no', present but not set, and the invalid 'whatever'. There is a separate test for the parameter not present.  |rtl=yes adds dir="rtl" to the text's enclosing <span> and inserts the &lrm; marker.  ]]  function p:test_03_lang_rtl()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang|code=ar|text=text|rtl=', '}}', '{{#invoke:Lang|lang|code=ar|text=text|rtl=', '}}',  {  {'yes'},  {'no'},  {''},  {'whatever'},  }, {nowiki=1})  self:preprocess_equals_preprocess('{{#invoke:Lang/zona de pruebas|lang|code=ar|text=text}}', '{{#invoke:Lang|lang|code=ar|text=text}}',  {nowiki=1}) end   --[[ -------------------------- < I E T F _ D E C O D I N G > --------------------------  Tests module parameter |code= with values that should not produce error messages:  'de', 'de-ch', 'de-CH-1901', 'ru-RU-petr1708', '1ca', es-419.  ]]  function p:test_04_lang_ietf()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang|text=text|code=', '}}', '{{#invoke:Lang|lang|text=text|code=', '}}',  {  {'de'}, -- code  {'nav'}, -- code  {'1ca'}, -- non-standard code  {'cmn-Latn'}, -- code-script; shall italicize text  {'he-hebr'}, -- code-script; shall insert rtl  {'de-ch'}, -- code-region  {'de-1901'}, -- code-numeric variant  {'ru-petr1708'}, -- code-alnum variant  {'ca-valencia'}, -- code-alpha variant  {'ru-ru-petr1708'}, -- code-region-variant  {'es-419'}, -- code-numeric region  {'ru-Cyrl-RU'}, -- code-script-region  {'ca-419-valencia'}, -- code-numeric reigion-variant  {'cel-x-proto'}, -- private-use  }, {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/zona de pruebas|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   --[[ ========================== < L A N G _ X X _ T E S T S > ========================== ]]  --[[ -------------------------- < I T A L I C > --------------------------  - 'yes', - 'no', - 'invert', - 'italic', - present but not set, - invalid 'whatever', - parameter not present.   |italic=yes or |italic=no overrides every other parameter that might set the rendered text's font.  ]]  function p:test_06_lang_xx_italic()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|code=ar|text=text|italic=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|italic=', '}}',  {  {'yes'},  {'no'},  {'invert'},  {'italic'},  {''},  {'whatever'},  }, {nowiki=1})  self:preprocess_equals_preprocess('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|code=ar|text}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text}}',  {nowiki=1}) end   --[[ -------------------------- < I T A L I C _ W I T H _ S C R I P T > --------------------------  Tests module parameter |italic=yes and |italic=no when |script=arab or |script=latn is set.  |italic=yes should override whatever |script= might say.  The value assigned to |script= shall be appended to the language code; for |script=arab the module shall add dir="rtl" to the text's enclosing <span> and insert the &lrm; marker.  ]]  function p:test_07_lang_xx_italic_with_script()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|code=ar|text=text|italic=yes|script=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|italic=yes|script=', '}}',  {  {'arab'},  {'latn'},  }, {nowiki=1})  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|code=ar|text=text|italic=no|script=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|italic=no|script=', '}}',  {  {'arab'},  {'latn'},  }, {nowiki=1}) end   --[[ -------------------------- < S C R I P T > --------------------------  Tests module parameter |script=arab and |script=latn with |italic= preset but not set and |italic= not present.  |script=arab shall not italicize text. |script=latn shall italicize text.  The value assigned to |script= shall be appended to the language code; for |script=arab the module shall add dir="rtl" to the text's enclosing <span> and insert the &lrm; marker.  There is no {{lang}} version of this test because {{lang}} has no need for separate |script=, |region=, and |variant= parameters - those subtags can all be added to the IETF language code in the template's first positional parameter ({{{1}}}).  ]]  function p:test_08_lang_xx_script()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|code=ar|text=text|italic=|script=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|italic=|script=', '}}',  {  {'arab'},  {'latn'},  }, {nowiki=1})  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|code=ar|text=text|script=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|script=', '}}',  {  {'arab'},  {'latn'},  }, {nowiki=1}) end   --[[ -------------------------- < R T L > --------------------------  Tests module parameter |rtl= with values 'yes', 'no', present but not set, and the invalid 'whatever'. There is a separate test for the parameter not present.  |rtl=yes adds dir="rtl" to the text's enclosing <span> and inserts the &lrm; marker.  ]]  function p:test_09_lang_xx_rtl()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|code=ar|text=text|rtl=', '}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text=text|rtl=', '}}',  {  {'yes'},  {'no'},  {''},  {'whatever'},  }, {nowiki=1})  self:preprocess_equals_preprocess('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|code=ar|text}}', '{{#invoke:Lang|lang_xx_inherit|code=ar|text}}',  {nowiki=1}) end   --[[--------------------------< L A N G _ T R A N S L I T >------------------------------------------------------------------------  Tests various supported combinations of translit formats.  ]]  function p:test_10_lang_xx_translit()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|nocat=yes|', '}}', '{{#invoke:Lang|lang_xx_inherit|nocat=yes|', '}}',  {  {'code=ar|rtl=yes|text=نص العنصر النائب|translit=nasu aleunsur alnnay'},  {'code=ar|rtl=yes|text=نص العنصر النائب|translit=nasu aleunsur alnnay|translit-script=Arab'},  {'code=ar|rtl=yes|text=نص العنصر النائب|translit=nasu aleunsur alnnay|translit-std=DIN'},  {'code=ar|rtl=yes|text=نص العنصر النائب|translit=nasu aleunsur alnnay|translit-std=ALA'},  {'code=ar|عربى|translit=ʿarabī'},  {'code=ar|عربى|translit=ʿarabī|lit=Arabic'},  {'code=ar|عربى|translit=ʿarabī|translation=Arabic'},  {'code=ar|عربى|translit=ʿarabī|lit=Arabic|links=no'},  {'code=ar|عربى|translation=Arabic'},  {'code=ar|عربى|translation=Arabic|links=no'},  {'code=ff|text=𞤁𞤢𞤲𞤣𞤢𞤴𞤯𞤫|translit=something|translit-script=Adlm'},  {'code=ff|text=𞤁𞤢𞤲𞤣𞤢𞤴𞤯𞤫|translit=something|translit-script=Adlm|translit-std=ALA'},  {'code=ar|text=نص العنصر النائب|translit=nasu aleunsur alnnay|translit-std=DIN|translit-script=arab'},  {'code=gem|text=test|translit=ʿarabī|translation=Arabic'}, -- not valid translations, the test is here to see the link with a collective lagnauge  {'code=ath|text=test|translit=ʿarabī|translation=Arabic'}, -- not valid translations, the test is here to see the link with a collective lagnauge  }, {nowiki=1}) end   --[[--------------------------< L I N K _ A N D _ L A B E L >------------------------------------------------------------------------  Tests various supported combinations of |link= and |label= combinations.  ]]  function p:test_11_lang_xx_link_and_label()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|nocat=yes|', '}}', '{{#invoke:Lang|lang_xx_inherit|nocat=yes|', '}}',  {  {'code=uk|морити голодом|lit=to kill by starvation|translit=moryty holodom|label=none'},  {'code=uk|морити голодом|lit=to kill by starvation|translit=moryty holodom|label=none|link=no'},  {'code=ff|text=test|translit=something|translit-script=Adlm|label=none'},  {'code=ff|text=test|translit=something|translit-script=Adlm|label=test label'},  }, {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_12_lang_xx_invert_italics()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|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   --[[ ========================== < T R A N S L _ T E S T S > ========================== ]]  --[[ -------------------------- < T R A N S L _ F O R M A T S > --------------------------  Tests various supported combinations of translit formats.  ]]  function p:test_13_transl_formats()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|transl|nocat=yes|', '}}', '{{#invoke:Lang|transl|nocat=yes|', '}}',  {  -- language with transliteration standard (std) tests:  {'ja|iso|test'}, -- get code value: x (y language) transliteration  {'kana|iso|test'}, -- get script value: x (y script) transliteration  {'oto|iso|test'}, -- get default value: x transliteration   -- code or script found in "no_std" tests:  -- TODO: no current code example {'???|test'}, -- no_std code:  {'xsux|test'}, -- no_std script: x transliteration (whatever the override value is)   -- translit-script tests:  {'Cyrl|š'}, -- script: x-script transliteration   -- no translit-script or std tests:  {'ar|test'}, -- romanization: x-language romanization  {'oto|test'}, -- romanization collective: x languages romanization   }, {nowiki=1}) end   --[[ -------------------------- < I T A L I C S > --------------------------  Tests module parameter |italic= with values 'yes', 'no', present but not set, default, unset, and the invalid 'whatever'. There is a separate test for the parameter not present.  ]]  function p:test_14_transl_italics()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|transl|nocat=yes|', '}}', '{{#invoke:Lang|transl|nocat=yes|', '}}',  {  {'ar|nasu aleunsur alnnayib|italic='},  {'ar|nasu aleunsur alnnayib|italic=yes'},  {'ar|nasu aleunsur alnnayib|italic=no'},  {'ar|nasu aleunsur alnnayib|italic=default'},  {'ar|nasu aleunsur alnnayib|italic=whatever'},  {'ar|nasu \'\'aleunsur\'\' alnnayib|italic=unset'},  {'Arab|nasu \'\'aleunsur\'\' alnnayib|italic=unset'},  }, {nowiki=1}) end   --[[ ========================== < C A T E G O R Y _ F R O M _ T A G _ T E S T S > ========================== ]]  --[[ -------------------------- < C A T E G O R Y _ F R O M _ T A G > --------------------------  Returns category links from IETF tags.  A complete list of valid tests can be found here: * Módulo:Lang/testcases/ISO 639-1 category from tag * Módulo:Lang/testcases/ISO 639-3-1 category from tag (A–H) * Módulo:Lang/testcases/ISO 639-3-2 category from tag (I–N) * Módulo:Lang/testcases/ISO 639-3-3 category from tag (O–Z) * Módulo:Lang/testcases/ISO 639 deprecated and override category from tag  ]]  function p:test_15_category_from_tag()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|category_from_tag|nocat=yes|', '}}', '{{#invoke:Lang|category_from_tag|nocat=yes|', '}}',  {  {'fr|link=yes'},  {'ber|link=yes'},  {'en|link=yes'},  {'en-gb|link=yes'},  {'fr'},  {'FR'},  {'ber'},  {'BER'},  {'en'},  {'EN'},  {'en-gb'},  {'EN-GB'},  }) end   --[[ ========================== < N A M E _ F R O M _ T A G _ T E S T S > ========================== ]]  --[[ -------------------------- < N A M E _ F R O M _ T A G > --------------------------  Returns language names from IETF tags.  A complete list of valid tests can be found here: * Módulo:Lang/testcases/ISO 639-1 name from tag * Módulo:Lang/testcases/ISO 639-3-1 name from tag (A–H) * Módulo:Lang/testcases/ISO 639-3-2 name from tag (I–N) * Módulo:Lang/testcases/ISO 639-3-3 name from tag (O–Z) * Módulo:Lang/testcases/ISO 639 deprecated and override name from tag  ]]  function p:test_16_name_from_tag()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|name_from_tag|nocat=yes|', '}}', '{{#invoke:Lang|name_from_tag|nocat=yes|', '}}',  {  {'fr|link=yes'},  {'ber|link=yes'},  {'en|link=yes'},  {'en-gb|link=yes'},  {'fr'},  {'FR'},  {'ber'},  {'BER'},  {'en'},  {'EN'},  {'en-gb'},  {'EN-GB'},  }) end   --[[ ========================== < T A G _ F R O M _ N A M E _ T E S T S > ========================== ]]  --[[ -------------------------- < T A G _ F R O M _ N A M E > --------------------------  Returns language IETF tags from language names.  A complete list of valid tests can be found here: * Módulo:Lang/testcases/ISO 639-1 tag from name * Módulo:Lang/testcases/ISO 639-3-1 tag from name (A–H) * Módulo:Lang/testcases/ISO 639-3-2 tag from name (I–N) * Módulo:Lang/testcases/ISO 639-3-3 tag from name (O–Z) * Módulo:Lang/testcases/ISO 639 deprecated and override tag from name  ]]  function p:test_17_tag_from_name()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|tag_from_name|nocat=yes|', '}}', '{{#invoke:Lang|tag_from_name|nocat=yes|', '}}',  {  {'francés'},  {'Francés'},  {'FRANCÉS'},  {'Bereber'},  {'bereber'},  {'Inglés británico'},  {'en'},  {'EN'},  }) end   --[[ ========================== < I S _ I E T F _ T A G _ T E S T S > ========================== ]]  --[[ -------------------------- < I S _ I E T F _ T A G > --------------------------  Returns true if valid IETF tag.  ]]  function p:test_18_is_ietf_tag()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|is_ietf_tag|nocat=yes|', '}}', '{{#invoke:Lang|is_ietf_tag|nocat=yes|', '}}',  {  {'francés'},  {'Francés'},  {'FRANCÉS'},  {'Bereber'},  {'bereber'},  {'Inglés británico'},  {'fr'},  {'FR'},  {'ber'},  {'BER'},  {'en'},  {'EN'},  {'en-gb'},  {'EN-GB'},  }) end   --[[ ========================== < I S _ L A N G _ N A M E _ T E S T S > ========================== ]]  --[[ -------------------------- < I S _ L A N G _ N A M E > --------------------------  Returns true if valid language name.  ]]  function p:test_19_is_lang_name()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|is_lang_name|nocat=yes|', '}}', '{{#invoke:Lang|is_lang_name|nocat=yes|', '}}',  {  {'francés'},  {'Francés'},  {'FRANCÉS'},  {'Bereber'},  {'bereber'},  {'Inglés británico'},  {'fr'},  {'FR'},  {'ber'},  {'BER'},  {'en'},  {'EN'},  {'en-gb'},  {'EN-GB'},  }) end   --[[ ========================== < E R R O R S > ========================== ]]  --[[--------------------------< L A N G _ E R R O R S >------------------------------------------------------------------------  Lang errors.  ]]  function p:test_20_lang_errors()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang|nocat=yes|', '}}', '{{#invoke:Lang|lang|nocat=yes|', '}}',  {  {''}, -- no text  {'fr'}, -- no text  {'text=text'}, -- missing language tag  {'fr|code=fr|text'}, -- conflicting |1= and |code=   {'fr|text|text=text'}, -- conflicting |2= and |text=  {'proto=proto-y-bad|text=text'}, -- invalid |proto=  {'fr|\'\'italics\'\''}, -- text has italic markup  {'fr|text={{lang|fr|text=text}}'}, -- text already uses lang attribute  {'fr|malformed\'\'\'\'\'\''}, -- text has malformed markup  {'1ca|text'}, -- unrecognized language tag: 1ca  {'zz|text'}, -- unrecognized language code  {'glg|text'}, -- code: glg promoted to code: gl  {'iw|text'}, -- code: iw is deprecated  }, {nowiki=1}) end   --[[ -------------------------- < L A N G _ X X _ E R R O R S > --------------------------  Lang-xx errors.  ]]   function p:test_21_lang_xx_errors()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|lang_xx_inherit|nocat=yes|', '}}', '{{#invoke:Lang|lang_xx_inherit|nocat=yes|', '}}',  {  {''}, -- no text  {'code=fr'}, -- no text  {'text=text'}, -- missing language tag  {'code=fr|text|text=text'}, -- conflicting {{{1}}} and |text=  {'code=fr|text|translit|translit=translit'}, -- conflicting {{{2}}} and |translit=  {'code=fr|text|lit|lit=lit'}, -- conflicting {{{3}}} and |lit= or |translation=  {'code=fr|text|translation|translation=translation'}, -- conflicting {{{3}}} and |lit= or |translation=  {'code=fr|text|lit=lit|translation=translation'}, -- conflicting |lit= and |translation=  {'code=fr|{{lang|fr|text}}'}, -- text already uses lang attribute  {'code=fr-Latn|script=Latn|text'}, -- redundant script tag  {'code=fr|script=nonsense|text'}, -- unrecognized script: nonsense for code fr  {'code=ar|script=Arab|text'}, -- script: script: arab not supported for code: ar  {'code=en-US|region=US|text'}, -- redundant region tag  {'code=de-XL|text'}, -- unrecognized region: xl for code de  {'code=de-1901|variant=1901|text'}, -- redundant variant tag  {'code=de-19022|text'}, -- unrecognized variant: 19022  {'code=de|script=Armn|variant=1901|text'}, -- unrecognized variant: 1901 for code-script pair: de-armn  {'code=en|variant=1901|text'}, -- unrecognized variant: 1901 for code: en  {'code=es-x-419|text'}, -- unrecognized private tag: 419  {'code=ar|rtl=yes|نص العنصر النائب|nasu aleunsur alnnayib|translit-std=bob'}, --invalid |translit-std=: bob  {'code=ar|text=نص العنصر النائب|translit=nasu aleunsur alnnay|translit-std=DIN|translit-script=ar'}, -- invalid |translit-script= value  }, {nowiki=1}) end   --[[ -------------------------- < T R A N S L _ E R R O R S > --------------------------  Transl errors.  ]]  function p:test_22_transl_errors()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|transl|nocat=yes|', '}}', '{{#invoke:Lang|transl|nocat=yes|', '}}',  {  {'al-Khwarizmi'},  {'ar'},  {'at|al-Khwarizmi'},  {'ar|AL|al-Khwarizmi'},  {'Arab|nasu \'\'aleunsur\'\' alnnayib|italic=yes|italics=no'},  }, {nowiki=1}) end   --[[ -------------------------- < C A T E G O R Y _ F R O M _ T A G _ E R R O R S > --------------------------  category_from_tag errors.  ]]  function p:test_23_category_from_tag_errors()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|category_from_tag|nocat=yes|', '}}', '{{#invoke:Lang|category_from_tag|nocat=yes|', '}}',  {  {'sfsfsfs'},  }, {nowiki=1}) end   --[[ -------------------------- < N A M E _ F R O M _ T A G _ E R R O R S > --------------------------  name_from_tag errors.  A complete list of valid tests can be found here: * Módulo:Lang/testcases/ISO 639-1 name from tag * Módulo:Lang/testcases/ISO 639-3-1 name from tag (A–H) * Módulo:Lang/testcases/ISO 639-3-2 name from tag (I–N) * Módulo:Lang/testcases/ISO 639-3-3 name from tag (O–Z) * Módulo:Lang/testcases/ISO 639 deprecated and override name from tag  ]]  function p:test_24_name_from_tag_errors()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|name_from_tag|nocat=yes|', '}}', '{{#invoke:Lang|name_from_tag|nocat=yes|', '}}',  {  {'sfsfsfs'},  }, {nowiki=1}) end   --[[ -------------------------- < T A G _ F R O M _ N A M E _ E R R O R S > --------------------------  tag_from_name errors.  A complete list of valid tests can be found here: * Módulo:Lang/testcases/ISO 639-1 tag from name * Módulo:Lang/testcases/ISO 639-3-1 tag from name (A–H) * Módulo:Lang/testcases/ISO 639-3-2 tag from name (I–N) * Módulo:Lang/testcases/ISO 639-3-3 tag from name (O–Z) * Módulo:Lang/testcases/ISO 639 deprecated and override tag from name  ]]  function p:test_25_tag_from_name_errors()  self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|tag_from_name|nocat=yes|', '}}', '{{#invoke:Lang|tag_from_name|nocat=yes|', '}}',  {  {'sfsfsfs'},  }, {nowiki=1}) end   return p 

módulo, lang, tests, esta, subpágina, para, hacer, pruebas, unitarias, tests, módulo, lang, resultados, pueden, comprobar, página, discusión, módulo, lang, código, discusión, tests, comprobar, tests, subpáginas, enlaces, local, require, módulo, unittests, test. Esta es la subpagina para hacer las pruebas unitarias o tests de Modulo Lang Los resultados se pueden comprobar en la pagina de discusion Modulo Lang codigo doc discusion tests comprobar tests subpaginas enlaces local p require Modulo UnitTests lt L A N G T E S T S gt lt I T A L I C gt Tests module parameter italic with values yes no invert italic present but not set invalid whatever parameter not present italic yes or italic no overrides every other parameter that might set the rendered text s font function p test 01 lang italic self preprocess equals preprocess many invoke Lang zona de pruebas lang code ar text text italic invoke Lang lang code ar text text italic yes no invert italic whatever nowiki 1 self preprocess equals preprocess invoke Lang zona de pruebas lang code ar text text invoke Lang lang code ar text text nowiki 1 end lt I T A L I C W I T H S C R I P T gt Tests module parameter italic yes and italic no when script arab or script latn is set italic yes should override whatever script might say The value assigned to script shall be appended to the language code for script arab the module shall add dir rtl to the text s enclosing lt span gt and insert the amp lrm marker function p test 02 lang italic with script self preprocess equals preprocess many invoke Lang zona de pruebas lang code ar text text italic yes script invoke Lang lang code ar text text italic yes script arab latn nowiki 1 self preprocess equals preprocess many invoke Lang zona de pruebas lang code ar text text italic no script invoke Lang lang code ar text text italic no script arab latn nowiki 1 end lt R T L gt Tests module parameter rtl with values yes no present but not set and the invalid whatever There is a separate test for the parameter not present rtl yes adds dir rtl to the text s enclosing lt span gt and inserts the amp lrm marker function p test 03 lang rtl self preprocess equals preprocess many invoke Lang zona de pruebas lang code ar text text rtl invoke Lang lang code ar text text rtl yes no whatever nowiki 1 self preprocess equals preprocess invoke Lang zona de pruebas lang code ar text text invoke Lang lang code ar text text nowiki 1 end lt I E T F D E C O D I N G gt Tests module parameter code with values that should not produce error messages de de ch de CH 1901 ru RU petr1708 1ca es 419 function p test 04 lang ietf self preprocess equals preprocess many invoke Lang zona de pruebas lang text text code invoke Lang lang text text code de code nav code 1ca non standard code cmn Latn code script shall italicize text he hebr code script shall insert rtl de ch code region de 1901 code numeric variant ru petr1708 code alnum variant ca valencia code alpha variant ru ru petr1708 code region variant es 419 code numeric region ru Cyrl RU code script region ca 419 valencia code numeric reigion variant cel x proto private use nowiki 1 end lt I N V E R T I T A L I C S gt Tests text ouput with italic invert set function p test 05 lang invert italics self preprocess equals preprocess many invoke Lang zona de pruebas 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 lt L A N G X X T E S T S gt lt I T A L I C gt yes no invert italic present but not set invalid whatever parameter not present italic yes or italic no overrides every other parameter that might set the rendered text s font function p test 06 lang xx italic self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit code ar text text italic invoke Lang lang xx inherit code ar text text italic yes no invert italic whatever nowiki 1 self preprocess equals preprocess invoke Lang zona de pruebas lang xx inherit code ar text invoke Lang lang xx inherit code ar text nowiki 1 end lt I T A L I C W I T H S C R I P T gt Tests module parameter italic yes and italic no when script arab or script latn is set italic yes should override whatever script might say The value assigned to script shall be appended to the language code for script arab the module shall add dir rtl to the text s enclosing lt span gt and insert the amp lrm marker function p test 07 lang xx italic with script self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit code ar text text italic yes script invoke Lang lang xx inherit code ar text text italic yes script arab latn nowiki 1 self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit code ar text text italic no script invoke Lang lang xx inherit code ar text text italic no script arab latn nowiki 1 end lt S C R I P T gt Tests module parameter script arab and script latn with italic preset but not set and italic not present script arab shall not italicize text script latn shall italicize text The value assigned to script shall be appended to the language code for script arab the module shall add dir rtl to the text s enclosing lt span gt and insert the amp lrm marker There is no lang version of this test because lang has no need for separate script region and variant parameters those subtags can all be added to the IETF language code in the template s first positional parameter 1 function p test 08 lang xx script self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit code ar text text italic script invoke Lang lang xx inherit code ar text text italic script arab latn nowiki 1 self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit code ar text text script invoke Lang lang xx inherit code ar text text script arab latn nowiki 1 end lt R T L gt Tests module parameter rtl with values yes no present but not set and the invalid whatever There is a separate test for the parameter not present rtl yes adds dir rtl to the text s enclosing lt span gt and inserts the amp lrm marker function p test 09 lang xx rtl self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit code ar text text rtl invoke Lang lang xx inherit code ar text text rtl yes no whatever nowiki 1 self preprocess equals preprocess invoke Lang zona de pruebas lang xx inherit code ar text invoke Lang lang xx inherit code ar text nowiki 1 end lt L A N G T R A N S L I T gt Tests various supported combinations of translit formats function p test 10 lang xx translit self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit nocat yes invoke Lang lang xx inherit nocat yes code ar rtl yes text نص العنصر النائب translit nasu aleunsur alnnay code ar rtl yes text نص العنصر النائب translit nasu aleunsur alnnay translit script Arab code ar rtl yes text نص العنصر النائب translit nasu aleunsur alnnay translit std DIN code ar rtl yes text نص العنصر النائب translit nasu aleunsur alnnay translit std ALA code ar عربى translit ʿarabi code ar عربى translit ʿarabi lit Arabic code ar عربى translit ʿarabi translation Arabic code ar عربى translit ʿarabi lit Arabic links no code ar عربى translation Arabic code ar عربى translation Arabic links no code ff text translit something translit script Adlm code ff text translit something translit script Adlm translit std ALA code ar text نص العنصر النائب translit nasu aleunsur alnnay translit std DIN translit script arab code gem text test translit ʿarabi translation Arabic not valid translations the test is here to see the link with a collective lagnauge code ath text test translit ʿarabi translation Arabic not valid translations the test is here to see the link with a collective lagnauge nowiki 1 end lt L I N K A N D L A B E L gt Tests various supported combinations of link and label combinations function p test 11 lang xx link and label self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit nocat yes invoke Lang lang xx inherit nocat yes code uk moriti golodom lit to kill by starvation translit moryty holodom label none code uk moriti golodom lit to kill by starvation translit moryty holodom label none link no code ff text test translit something translit script Adlm label none code ff text test translit something translit script Adlm label test label nowiki 1 end lt I N V E R T I T A L I C S gt Tests text ouput with italic invert set function p test 12 lang xx invert italics self preprocess equals preprocess many invoke Lang zona de pruebas 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 lt T R A N S L T E S T S gt lt T R A N S L F O R M A T S gt Tests various supported combinations of translit formats function p test 13 transl formats self preprocess equals preprocess many invoke Lang zona de pruebas transl nocat yes invoke Lang transl nocat yes language with transliteration standard std tests ja iso test get code value x y language transliteration kana iso test get script value x y script transliteration oto iso test get default value x transliteration code or script found in no std tests TODO no current code example test no std code xsux test no std script x transliteration whatever the override value is translit script tests Cyrl s script x script transliteration no translit script or std tests ar test romanization x language romanization oto test romanization collective x languages romanization nowiki 1 end lt I T A L I C S gt Tests module parameter italic with values yes no present but not set default unset and the invalid whatever There is a separate test for the parameter not present function p test 14 transl italics self preprocess equals preprocess many invoke Lang zona de pruebas transl nocat yes invoke Lang transl nocat yes ar nasu aleunsur alnnayib italic ar nasu aleunsur alnnayib italic yes ar nasu aleunsur alnnayib italic no ar nasu aleunsur alnnayib italic default ar nasu aleunsur alnnayib italic whatever ar nasu aleunsur alnnayib italic unset Arab nasu aleunsur alnnayib italic unset nowiki 1 end lt C A T E G O R Y F R O M T A G T E S T S gt lt C A T E G O R Y F R O M T A G gt Returns category links from IETF tags A complete list of valid tests can be found here Modulo Lang testcases ISO 639 1 category from tag Modulo Lang testcases ISO 639 3 1 category from tag A H Modulo Lang testcases ISO 639 3 2 category from tag I N Modulo Lang testcases ISO 639 3 3 category from tag O Z Modulo Lang testcases ISO 639 deprecated and override category from tag function p test 15 category from tag self preprocess equals preprocess many invoke Lang zona de pruebas category from tag nocat yes invoke Lang category from tag nocat yes fr link yes ber link yes en link yes en gb link yes fr FR ber BER en EN en gb EN GB end lt N A M E F R O M T A G T E S T S gt lt N A M E F R O M T A G gt Returns language names from IETF tags A complete list of valid tests can be found here Modulo Lang testcases ISO 639 1 name from tag Modulo Lang testcases ISO 639 3 1 name from tag A H Modulo Lang testcases ISO 639 3 2 name from tag I N Modulo Lang testcases ISO 639 3 3 name from tag O Z Modulo Lang testcases ISO 639 deprecated and override name from tag function p test 16 name from tag self preprocess equals preprocess many invoke Lang zona de pruebas name from tag nocat yes invoke Lang name from tag nocat yes fr link yes ber link yes en link yes en gb link yes fr FR ber BER en EN en gb EN GB end lt T A G F R O M N A M E T E S T S gt lt T A G F R O M N A M E gt Returns language IETF tags from language names A complete list of valid tests can be found here Modulo Lang testcases ISO 639 1 tag from name Modulo Lang testcases ISO 639 3 1 tag from name A H Modulo Lang testcases ISO 639 3 2 tag from name I N Modulo Lang testcases ISO 639 3 3 tag from name O Z Modulo Lang testcases ISO 639 deprecated and override tag from name function p test 17 tag from name self preprocess equals preprocess many invoke Lang zona de pruebas tag from name nocat yes invoke Lang tag from name nocat yes frances Frances FRANCES Bereber bereber Ingles britanico en EN end lt I S I E T F T A G T E S T S gt lt I S I E T F T A G gt Returns true if valid IETF tag function p test 18 is ietf tag self preprocess equals preprocess many invoke Lang zona de pruebas is ietf tag nocat yes invoke Lang is ietf tag nocat yes frances Frances FRANCES Bereber bereber Ingles britanico fr FR ber BER en EN en gb EN GB end lt I S L A N G N A M E T E S T S gt lt I S L A N G N A M E gt Returns true if valid language name function p test 19 is lang name self preprocess equals preprocess many invoke Lang zona de pruebas is lang name nocat yes invoke Lang is lang name nocat yes frances Frances FRANCES Bereber bereber Ingles britanico fr FR ber BER en EN en gb EN GB end lt E R R O R S gt lt L A N G E R R O R S gt Lang errors function p test 20 lang errors self preprocess equals preprocess many invoke Lang zona de pruebas lang nocat yes invoke Lang lang nocat yes no text fr no text text text missing language tag fr code fr text conflicting 1 and code fr text text text conflicting 2 and text proto proto y bad text text invalid proto fr italics text has italic markup fr text lang fr text text text already uses lang attribute fr malformed text has malformed markup 1ca text unrecognized language tag 1ca zz text unrecognized language code glg text code glg promoted to code gl iw text code iw is deprecated nowiki 1 end lt L A N G X X E R R O R S gt Lang xx errors function p test 21 lang xx errors self preprocess equals preprocess many invoke Lang zona de pruebas lang xx inherit nocat yes invoke Lang lang xx inherit nocat yes no text code fr no text text text missing language tag code fr text text text conflicting 1 and text code fr text translit translit translit conflicting 2 and translit code fr text lit lit lit conflicting 3 and lit or translation code fr text translation translation translation conflicting 3 and lit or translation code fr text lit lit translation translation conflicting lit and translation code fr lang fr text text already uses lang attribute code fr Latn script Latn text redundant script tag code fr script nonsense text unrecognized script nonsense for code fr code ar script Arab text script script arab not supported for code ar code en US region US text redundant region tag code de XL text unrecognized region xl for code de code de 1901 variant 1901 text redundant variant tag code de 19022 text unrecognized variant 19022 code de script Armn variant 1901 text unrecognized variant 1901 for code script pair de armn code en variant 1901 text unrecognized variant 1901 for code en code es x 419 text unrecognized private tag 419 code ar rtl yes نص العنصر النائب nasu aleunsur alnnayib translit std bob invalid translit std bob code ar text نص العنصر النائب translit nasu aleunsur alnnay translit std DIN translit script ar invalid translit script value nowiki 1 end lt T R A N S L E R R O R S gt Transl errors function p test 22 transl errors self preprocess equals preprocess many invoke Lang zona de pruebas transl nocat yes invoke Lang transl nocat yes al Khwarizmi ar at al Khwarizmi ar AL al Khwarizmi Arab nasu aleunsur alnnayib italic yes italics no nowiki 1 end lt C A T E G O R Y F R O M T A G E R R O R S gt category from tag errors function p test 23 category from tag errors self preprocess equals preprocess many invoke Lang zona de pruebas category from tag nocat yes invoke Lang category from tag nocat yes sfsfsfs nowiki 1 end lt N A M E F R O M T A G E R R O R S gt name from tag errors A complete list of valid tests can be found here Modulo Lang testcases ISO 639 1 name from tag Modulo Lang testcases ISO 639 3 1 name from tag A H Modulo Lang testcases ISO 639 3 2 name from tag I N Modulo Lang testcases ISO 639 3 3 name from tag O Z Modulo Lang testcases ISO 639 deprecated and override name from tag function p test 24 name from tag errors self preprocess equals preprocess many invoke Lang zona de pruebas name from tag nocat yes invoke Lang name from tag nocat yes sfsfsfs nowiki 1 end lt T A G F R O M N A M E E R R O R S gt tag from name errors A complete list of valid tests can be found here Modulo Lang testcases ISO 639 1 tag from name Modulo Lang testcases ISO 639 3 1 tag from name A H Modulo Lang testcases ISO 639 3 2 tag from name I N Modulo Lang testcases ISO 639 3 3 tag from name O Z Modulo Lang testcases ISO 639 deprecated and override tag from name function p test 25 tag from name errors self preprocess equals preprocess many invoke Lang zona de pruebas tag from name nocat yes invoke Lang tag from name nocat yes sfsfsfs nowiki 1 end return p Obtenido de https es wikipedia org w index php title Modulo Lang tests amp oldid 132693031, wikipedia, wiki, leyendo, leer, libro, biblioteca,

español

, española, descargar, gratis, descargar gratis, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, imagen, música, canción, película, libro, juego, juegos