Module:inc-ohi-translit/testcases
Jump to navigation
Jump to search
Documentation for this module may be created at Module:inc-ohi-translit/testcases/doc
-- Unit tests for [[Module:inc-ohi-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local inc_ohi_translit = require('Module:inc-ohi-translit')
local full_link = require('Module:links').full_link
local inc_ohi = require('Module:languages').getByCode('inc-ohi')
local function link(word)
return full_link{ term = word, lang = inc_ohi, tr = "-" }
end
--TO DO
function tests:do_test_translit(arabic, roman)
self:equals(link(arabic), inc_ohi_translit.tr(arabic, 'inc-ohi', 'ur-Arab'), roman)
end
function tests:test_translit_arabic()
local examples = {
{'ناتی', 'naty'},
{'ناتي', 'naty'},
{'سہس', 'shs'},
{'سهس', 'shs'},
{'شریعت', "śry't"},
{'اکڙ', 'akṛ'},
{'عورت', "'vrt"},
{'هوٿ', 'hvṭ'},
{'ہوٹ', 'hvṭ'},
{'اے', 'ae'},
{'هيں', 'hyṉ'},
{'بھيد', 'bhyd'},
{'کئ', 'ky'},
{'کوئے', 'kvye'},
{'سُورَۃ', 'svrh'},
{'فَوراً', 'fvra'},
{'گان٘وں', 'ganvṉ'},
{'چائے', 'caye'},
{'کُھلْواؤ', 'khlvav'},
{'ماشاءالہ', "maśa'alh"},
{'ﷲ', "alah"},
{'قرآن', 'qrān'},
{'آندھی', 'āndhy'},
{'زکوٰۃ', 'zkvh'},
}
self:iterate(examples, "do_test_translit")
end
return tests