Documentation for this module may be created at Модул:fa-translit/testcases/doc

-- Unit tests for [[Module:fa-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local fa_translit = require('Module:fa-translit')
local m_links = require('Module:links')

local fa = require('Module:languages').getByCode('fa')
local function link(term)
	return m_links.full_link{term = term, lang = fa}
end

function tests:do_test_translit(Pers, roman, xlit)
	self:equals(link(Pers), fa_translit.tr(Pers, 'fa', 'fa-Arab'), roman)
end

function tests:test_translit_persian()
	local examples = {
		{ 'سَرانجام', "saranjâm" },
		{ 'سَرانْجام', "saranjâm" },
		{ 'سَرَانْجَام', "saranjâm" },
		{ 'کُروز', "koruz" },
		{ 'کُرُوز', "korouz" },
		{ 'طَنین', "tanin" },
		{ 'طَنِین', "taneyn" },	
		{ 'عَصاً', "’asan" },	
		{ 'خانه', "xâne" },	
		{ 'خانِه', "xâne" },	
		{ 'کُرِۀ شُمالی', "kore-ye šomâli" },	
		{ 'ضَمّه', "zamme" },
		{ 'ضَمِّه', "zamme" },
		{ 'وُدکا', "vodkâ" },
		{ 'اَرمَنِستان', "armanestân" },
		{ 'باکو', "bâku" },
	}
	self:iterate(examples, "do_test_translit")
end	

return tests