Jump to content

Module:inc-ohi-translit/testcases

From Wiktionary, the free dictionary

This is the unit-testing module for Module:inc-ohi-translit/testcases.

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_arabic:
Passedناتیnatynaty
Passedناتيnatynaty
Passedسہسshsshs
Passedسهسshsshs
Passedشریعتśry'tśry't
Passedاکڙakṛakṛ
Passedعورت'vrt'vrt
Passedهوٿhvṭhvṭ
Passedہوٹhvṭhvṭ
Passedاےaeae
Passedهيںhyṉhyṉ
Passedبھيدbhydbhyd
Passedکئkyky
Passedکوئےkvyekvye
Passedسُورَۃsvrhsvrh
Passedفَوراًfvrafvra
Passedگان٘وںganvṉganvṉ
Passedچائےcayecaye
Passedکُھلْواؤkhlvavkhlvav
Passedماشاءالہmaśa'alhmaśa'alh
Passedalahalah
Passedقرآنqrānqrān
Passedآندھیāndhyāndhy
Passedزکوٰۃzkvhzkvh

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