Module:Vital article/testcases

-- Unit tests for Module:. Click talk page to run tests. local p = require('Module:UnitTests')

local test_link_cases = { {'philosophy', 'philosophy'}, {'Calamotropha punctivenellus', 'Calamotropha punctivenellus'}, {'non-article', 'non-article'}, {'Philosophy', 'Philosophy 1'}, {'Food', 'Food 2'}, {'Euclid', 'Euclid 3'}, {'Statue of Liberty', 'Statue of Liberty 4'}, {'Cratonic sequence', 'Cratonic sequence 5'}, {'Infinity', 'Infinity 3'}, {'1', '1 4'} }

local test_level_cases = { ['Philosophy'] = 1, ['Astronomy'] = 2, ['Homer'] = 3, ['Thallophyca'] = 0, ['non-article'] = 0, ['0'] = 3,	['1'] = 4,	['2666'] = 5, }

-- 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('', 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('', link_value) end end

function p:test_link_normal_vs_sandbox for _, v in ipairs(test_link_cases) do		local page = v[1] self:preprocess_equals_preprocess(			,			) end end

--function p:test_levels --	for k, v in pairs(test_level_cases) do --		self:preprocess_equals( --			'', tostring(v)) --	end --end

return p