Modulo:Dati popolazione/test: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
aggiungo test |
altri test |
||
Riga 1:
-- Unit tests per [[Modulo:Dati popolazione]]. Cliccare sulla pagina di discussione per eseguire i test.
local p = require("Module:UnitTests")
function p:test_alias_dei_parametri()
self:preprocess_equals_preprocess_many("{{#invoke:Dati popolazione/sandbox|main|DE-BB|12071414|", "}}", "{{Dati popolazione DE-BB|12071414|", "}}", {
{"data", "STAND"},
{"fonte", "QUELLE"},
})
end
function p:test_ordine_di_precedenza_senza_elemento_Wikidata()
Riga 9 ⟶ 16:
})
self:preprocess_equals_preprocess("{{#invoke:Dati popolazione/sandbox|main|DE-BB|12071414||valore manuale}}", "{{formatnum:{{Dati popolazione DE-BB|12071414}}}}")
self:preprocess_equals_preprocess_many("{{#invoke:Dati popolazione/sandbox|main|", "}}", "{{Dati popolazione
{"DE-BB|12071414|STAND|valore manuale", "DE-BB|12071414|STAND"},
{"DE-BB|12071414|QUELLE|valore manuale", "DE-BB|12071414|QUELLE"},
})
end
Riga 64 ⟶ 71:
function p:test_individuazione_template_CZ()
self:preprocess_equals_preprocess("{{#invoke:Dati popolazione/sandbox|main|from=Q894336}}", "{{formatnum:{{Dati popolazione CZ-JC|031544299}}}}")
self:preprocess_equals_preprocess_many("{{#invoke:Dati popolazione/sandbox|main|", "}}", "{{Dati popolazione ", "}}", {
{"from=Q894336|||STAND", "CZ-JC|031544299|STAND"},
{"from=Q894336|||QUELLE", "CZ-JC|031544299|QUELLE"},
})
end
function p:test_codici_associati_manualmente_a_elementi_Wikidata_nella_pagina_di_configurazione()
self:preprocess_equals_preprocess("{{#invoke:Dati popolazione/sandbox|main|from=Q659561}}", "{{formatnum:{{Dati popolazione CH-GR|B1821}}}}")
self:preprocess_equals_preprocess_many("{{#invoke:Dati popolazione/sandbox|main|", "}}", "{{Dati popolazione ", "}}", {
{"from=Q659561|||STAND", "CH-GR|B1821|STAND"},
{"from=Q659561|||QUELLE", "CH-GR|B1821|QUELLE"},
})
end
|