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]]'},
{ 'non-article', '[[non-article]]' }
}
-- Example unit test.
function p:test_link()
for _, v in ipairs(test_link_cases) do
local page, link_value = v[1], v[2]
self:preprocess_equals('{{#invoke:Vital article|link|page=' .. page .. '}}', link_value)
end
end
function p:test_link_sandbox()
for _, v in ipairs(test_link_cases) do
local page, link_value = v[1], v[2]
self:preprocess_equals('{{#invoke:Vital article/sandbox|link|page=' .. page .. '}}', link_value)
end
end
return p