Jump to content

Module:dv-translit/testcases

From Wiktionary, the free dictionary

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

1 of 20 tests failed. (refresh)

TextExpectedActualDiffers at
test_translit_dhivehi:
Passedކަރުދާސްkarudāskarudās
Passedއޮމާމަސްomāmasomāmas
Passedފޮތްfot̊fot̊
Passedގައްޤެgaqqegaqqe
Passedރަށްraṣ̊raṣ̊
Failedނަންnam̊nan̊3
Passedފަންfan̊fan̊
Passedރުއްruk̊ruk̊
Passedއަނބިaᵐbiaᵐbi
Passedޅޮނގުḷoⁿguḷoⁿgu
Passedހަނޑުhaⁿḍuhaⁿḍu
Passedހަނދުhaⁿduhaⁿdu
Passedފިއްޔެއްfiyyek̊fiyyek̊
Passedއަތްނބެއްat̊ᵐbek̊at̊ᵐbek̊
Passedލޯބިlōbilōbi
Passedލޯތްބެއްlōt̊bek̊lōt̊bek̊
Passedކަށިkaṣikaṣi
Passedކައްޓެއްkaṭṭek̊kaṭṭek̊
Passedހިނދުރިhiⁿdurihiⁿduri
Passedވައްދަvaddavadda

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

function tests:check_translit(Thaa, roman)
	self:equals('<span class="Thaa" lang="dv">[[' .. Thaa .. '#Dhivehi|' .. Thaa .. ']]</span>', dv_translit.tr(Thaa, 'dv', 'Thaa'), roman)
end

function tests:test_translit_dhivehi()
	self:iterate(
		{
			{ 'ކަރުދާސް', 'karudās' },
			{ 'އޮމާމަސް', 'omāmas' },
			{ 'ފޮތް', 'fot̊' },
			{ 'ގައްޤެ', 'gaqqe' },
			{ 'ރަށް', 'raṣ̊' },
			{ 'ނަން', 'nam̊' },
			{ 'ފަން', 'fan̊' },
			{ 'ރުއް', 'ruk̊' },
			{ 'އަނބި', 'aᵐbi' },
			{ 'ޅޮނގު', 'ḷoⁿgu' },
			{ 'ހަނޑު', 'haⁿḍu' },
			{ 'ހަނދު', 'haⁿdu' },
			{ 'ފިއްޔެއް', 'fiyyek̊' },
			{ 'އަތްނބެއް', 'at̊ᵐbek̊' },
			{ 'ލޯބި', 'lōbi' },
			{ 'ލޯތްބެއް', 'lōt̊bek̊' },
			{ 'ކަށި', 'kaṣi' },
			{ 'ކައްޓެއް', 'kaṭṭek̊' },
			{ 'ހިނދުރި', 'hiⁿduri' },
			{ 'ވައްދަ', 'vadda' }
		},
		"check_translit"
	)
end
 
return tests