Jump to content

Modulus:fa-translit/testcases

E Victionario

This is the unit-testing module for Module:fa-translit.

7 tests failed. (refresh)

Text Expected Actual Differs at
test_translit_persian:
Failed سَرانجام ‎(sarânjâm) saranjâm sarânjâm 4
Failed سَرانْجام ‎(sarânjâm) saranjâm sarânjâm 4
Failed سَرَانْجَام ‎(sarânjâm) saranjâm sarânjâm 4
Passed کُروز ‎(koruz) koruz koruz
Failed کُرُوز ‎(koruz) korouz koruz 4
Passed طَنین ‎(tanin) tanin tanin
Failed طَنِین ‎(tanin) taneyn tanin 4
Passed عَصاً ‎(’asan) ’asan ’asan
Failed خانه ‎(xânh) xâne xânh 5
Passed خانِه ‎(xâne) xâne xâne
Passed کُرِۀ شُمالی ‎(kore-ye šomâli) kore-ye šomâli kore-ye šomâli
Failed ضَمّه ‎(zammh) zamme zammh 5
Passed ضَمِّه ‎(zamme) zamme zamme
Passed وُدکا ‎(vodkâ) vodkâ vodkâ
Passed اَرمَنِستان ‎(armanestân) armanestân armanestân
Passed باکو ‎(bâku) bâku bâku

-- 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')

function tests:do_test_translit(Pers, roman, xlit)
	self:equals(m_links.full_link({term = Pers, lang = require('Module:languages').getByCode('fa')}, nil, true), fa_translit.tr(Pers, 'fa', 'fa-Arab'), roman)
end

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

return tests