localp=require('Módulo:UnitTests')localdata=mw.loadData('Módulo:Lang/data')--[[--------------------------< T E S T _ P A T T E R N S _ G E T >--------------------------------------------Crea una lista con los patrones de pruebas en la que cada entrada es a su vez otra lista con dos elementos: {"<code>", "<nombre del idioma según Módulo:Lang>"}]]localfunctiontest_patterns_get(iana_data)localname_from_tag=require('Módulo:Lang')._name_from_tag-- use Module:Lang to create the 'expected results'localtpats={}-- collect test patterns hereforcodeinpairs(iana_data)do-- list of names not needed herelocalpattern={}-- here we assemble the test pattern for <code>table.insert(pattern,code)-- add it to the patterntable.insert(pattern,name_from_tag({code}))-- call module:lang and add the 'expected results' for code to patterntable.insert(tpats,pattern)-- accumulate in list of patternsendlocalfunctioncomp(a,b)-- local function used by table.sort()returna[1]<b[1]-- ascending sort by codeendtable.sort(tpats,comp)-- make the list prettyreturntpats-- and doneend--[[--------------------------< T E S T _ N A M E _ F R O M _ T A G >------------------------------------------]]functionp:test_name_from_tag_iso_639_deprecated()localtest_patterns=test_patterns_get(data.lang_name_table.lang_dep)self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|name_from_tag|','}}','','',test_patterns,{nowiki=1})endfunctionp:test_name_from_tag_iso_639_override()localtest_patterns=test_patterns_get(data.override)self:preprocess_equals_preprocess_many('{{#invoke:Lang/zona de pruebas|name_from_tag|','}}','','',test_patterns,{nowiki=1})endreturnp
Enero 13, 2022
módulo, lang, tests, sobrescritos, desuso, name, from, este, módulo, tiene, página, documentación, crear, módulo, lang, tests, sobrescritos, desuso, name, from, código, discusión, tests, comprobar, tests, subpáginas, enlaces, local, require, módulo, unittests,. Este modulo no tiene pagina de documentacion crear Modulo Lang tests ISO 639 sobrescritos y en desuso name from tag codigo doc discusion tests comprobar tests subpaginas enlaces local p require Modulo UnitTests local data mw loadData Modulo Lang data lt T E S T P A T T E R N S G E T gt Crea una lista con los patrones de pruebas en la que cada entrada es a su vez otra lista con dos elementos lt code gt lt nombre del idioma segun Modulo Lang gt local function test patterns get iana data local name from tag require Modulo Lang name from tag use Module Lang to create the expected results local tpats collect test patterns here for code in pairs iana data do list of names not needed here local pattern here we assemble the test pattern for lt code gt table insert pattern code add it to the pattern table insert pattern name from tag code call module lang and add the expected results for code to pattern table insert tpats pattern accumulate in list of patterns end local function comp a b local function used by table sort return a 1 lt b 1 ascending sort by code end table sort tpats comp make the list pretty return tpats and done end lt T E S T N A M E F R O M T A G gt function p test name from tag iso 639 deprecated local test patterns test patterns get data lang name table lang dep self preprocess equals preprocess many invoke Lang zona de pruebas name from tag test patterns nowiki 1 end function p test name from tag iso 639 override local test patterns test patterns get data override self preprocess equals preprocess many invoke Lang zona de pruebas name from tag test patterns nowiki 1 end return p Obtenido de https es wikipedia org w index php title Modulo Lang tests ISO 639 sobrescritos y en desuso name from tag amp oldid 132772237, wikipedia, wiki, leyendo, leer, libro, biblioteca,