Module:Vital article/testcases
Appearance
![]() | This is the test cases page for the module Module:Vital article. Results of the test cases. |
-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local test_link_cases = {
{ 'Philosophy',
'[[Philosophy]] [[File:Círculos Concéntricos.svg|11px]] [[Wikipedia:Vital articles/Level/1#Level 1 vital articles (10 articles)|1]]'},
{ 'philosophy',
'[[philosophy]]'},
{ 'Calamotropha punctivenellus',
'[[Calamotropha punctivenellus]]'},
}
-- Example unit test.
function p:test_link()
for page, link_value in test_link_cases do
self:preprocess_equals('{{#invoke:Vital article|link|page=' .. page .. '}}', link_value)
end
self:preprocess_equals(
'{{#invoke:Vital article|link|page=Philosophy}}',
'[[Philosophy]] [[File:Círculos Concéntricos.svg|11px]] [[Wikipedia:Vital articles/Level/1#Level 1 vital articles (10 articles)|1]]')
self:preprocess_equals(
'{{#invoke:Vital article|link|page=philosophy}}',
'[[philosophy]]')
self:preprocess_equals(
'{{#invoke:Vital article|link|page=Calamotropha punctivenellus}}',
'[[Calamotropha punctivenellus]]')
end
function p:test_sandbox()
self:preprocess_equals(
'{{#invoke:Vital article|link|page=Philosophy}}',
'{{#invoke:Vital article/sandbox|link|page=Philosophy}}')
self:preprocess_equals(
'{{#invoke:Vital article|link|page=philosophy}}',
'{{#invoke:Vital article/sandbox|link|page=philosophy}}')
self:preprocess_equals(
'{{#invoke:Vital article|link|page=Calamotropha punctivenellus}}',
'{{#invoke:Vital article/sandbox|link|page=Calamotropha punctivenellus}}')
end
return p