Module:fa-translit/testcases

Hello, you have come here looking for the meaning of the word Module:fa-translit/testcases. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:fa-translit/testcases, but we will also tell you about its etymology, its characteristics and you will know how to say Module:fa-translit/testcases in singular and plural. Everything you need to know about the word Module:fa-translit/testcases you have here. The definition of the word Module:fa-translit/testcases will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:fa-translit/testcases, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_persian:
Passedگویَا کِهgōyā ki / guyâ kegōyā ki / guyâ ke
Passedحُقُوقhuqūq / hoğuğhuqūq / hoğuğ
Passedدَقِیقَهdaqīqa / dağiğedaqīqa / dağiğe
Passedخْوَرَاسَانxwarāsān / xorâsânxwarāsān / xorâsân
Passedخْویشxwēš / xišxwēš / xiš
Passedروزrōz / ruzrōz / ruz
Passedوَلیکِنwalēkin / valikenwalēkin / valiken
Passedشُویْšūy / šuyšūy / šuy
Passedشویْšōy / šuyšōy / šuy
Passedشِیرšīr / širšīr / šir
Passedشیرšēr / širšēr / šir
Passedشَوْهَرšawhar / šowharšawhar / šowhar
Passedکَسیkasē / kasikasē / kasi
Passedگویِشgōyiš / guyešgōyiš / guyeš
Passedبَیْنُ‌المِلَلِیbaynu-l-milalī / beyno-l-melalibaynu-l-milalī / beyno-l-melali
Passedشَوِیšawī / šavišawī / šavi
Passedشِوِیšiwī / ševišiwī / ševi
Passedشُویšuwē / šovišuwē / šovi
Passedخْوَدْرَوxwadraw / xodrowxwadraw / xodrow
Passedحقوق(nil)(nil)N/A
Passedعشق(nil)(nil)N/A
Passedنَمی‌دَانَم / نِمی‌دَانَمnamē-dānam / nemi-dânamnamē-dānam / nemi-dânam
Passedخَانَگِی / خَانِگِیxānagī / xânegixānagī / xânegi
Passedموز / مَوْزmōz / mowzmōz / mowz

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

local full_link = require('Module:links').full_link
local fa = require('Module:languages').getByCode('fa')
local trsp = "<span class=\"Zsym mention\" style=\"font-size:100%;\">&nbsp;/ </span>"

local rlm = require("Module:string/char")(0x200F) -- right-to-left mark

local function link(word)
	return full_link{ term = word, lang = fa, tr = "-" }
end

--TO DO
function tests:do_test_translit(arab, roman)
	self:equals(link(arab), fa_translit.tr(arab, 'fa', 'Persian'), roman)
end

function tests:test_translit_persian()
	local examples = {
		{ 'گویَا کِه', 'gōyā ki' .. trsp .. 'guyâ ke' },
		{ 'حُقُوق', 'huqūq' .. trsp .. 'hoğuğ' },
		{ 'دَقِیقَه', 'daqīqa' .. trsp .. 'dağiğe' },
		{ 'خْوَرَاسَان', 'xwarāsān' .. trsp .. 'xorâsân' },
		{ 'خْویش', 'xwēš' .. trsp .. 'xiš' },
		{ 'روز', 'rōz' .. trsp .. 'ruz' },
		{ 'وَلیکِن', 'walēkin' .. trsp .. 'valiken' },
		{ 'شُویْ', 'šūy' .. trsp .. 'šuy' },
		{ 'شویْ', 'šōy' .. trsp .. 'šuy' },
		{ 'شِیر', 'šīr' .. trsp .. 'šir' },
		{ 'شیر', 'šēr' .. trsp .. 'šir' },
		{ 'شَوْهَر', 'šawhar' .. trsp .. 'šowhar' },
		{ 'کَسی', 'kasē' .. trsp .. 'kasi' },
		{ 'گویِش', 'gōyiš' .. trsp .. 'guyeš' },
		{ 'بَیْنُ‌المِلَلِی', 'baynu-l-milalī' .. trsp .. 'beyno-l-melali' },
		{ 'شَوِی', 'šawī' .. trsp .. 'šavi' },
		{ 'شِوِی', 'šiwī' .. trsp .. 'ševi' },
		{ 'شُوی', 'šuwē' .. trsp .. 'šovi' },
		{ 'خْوَدْرَو', 'xwadraw' .. trsp .. 'xodrow' },
		-- should return nil
		{ 'حقوق', nil },
		{ 'عشق', nil },
		-- tests for vocalization override
		{ 'نَمی‌دَانَم//نِمی‌دَانَم', 'namē-dānam' .. trsp .. 'nemi-dânam' },
		{ 'خَانَگِی//خَانِگِی', 'xānagī' .. trsp .. 'xânegi' },
		{ 'موز//مَوْز', 'mōz' .. trsp .. 'mowz' },
		}
		self:iterate(examples, "do_test_translit")
end	

return tests