Module:en-ta-translit/testcases

From Linguifex
Revision as of 11:44, 2 December 2015 by wikt>மதனாஹரன் (check +1)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:en-ta-translit/testcases/doc

-- Unit tests for [[Module:en-ta-translit]]. Refresh page to run tests.
local p = require('Module:UnitTests')

local tests = require('Module:UnitTests')
local en_ta_translit = require('Module:en-ta-translit')

function tests:check_translit(roman, Taml)
	self:equals('<span class="roman" lang="ta">[[' .. roman .. '#Tamil|' .. roman .. ']]</span>', en_ta_translit.tr(roman, 'ta', 'roman'), Taml)
end

function tests:test_translit_tamil()
	self:check_translit('ca', 'ச')
	self:check_translit('co', 'சொ')
	self:check_translit('aḥkam', 'அஃகம்')
	self:check_translit('cā', 'சா')
	self:check_translit('iṭiyāppam', 'இடியாப்பம்')
	self:check_translit('amaiti', 'அமைதி')
	self:check_translit('akkai', 'அக்கை')
	self:check_translit('arjuṉaṉ', 'அர்ஜுனன்')
	self:check_translit('kuṅkumappū', 'குங்குமப்பூ')
	self:check_translit('apau', 'அபௌ')
	self:check_translit('acif', 'அசிஃப்')
	self:check_translit('rex', 'ரெஃஸ்')
	self:check_translit('azārudīṉ', 'அஃஜாருதீன்')
	self:check_translit('pūr puvassūva', 'பூர் புவஸ்ஸூவ')
	self:check_translit('123450', '௧௨௩௪௫௦')
	self:check_translit('auai', 'ஔஐ')
	self:check_translit('fabēsī', 'ஃபபேஸீ')
	self:check_translit('fabēsiī', 'ஃபபேஸிஈ')
	self:check_translit('aā', 'அஆ')
end
 
return p, tests