Jump to content

Module:Deva-Newa-translit/testcases

From Wiktionary, the free dictionary

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_newa:
Passedन्ह𑐤𑐤
Passedङ्ह𑐓𑐓
Passedर्ह𑐭𑐭
Passedल्ह𑐯𑐯
Passedम्ह𑐪𑐪
Passedञ्ह𑐙𑐙

-- Unit tests for [[Module:Deva-Newa-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local transliterate = require('Module:Deva-Newa-translit').tr

local function tag(text)
	return '<span class="Newa" lang="new">' .. text .. '</span>'
end

local options = { display = tag }
--TO DO
function tests:do_test_translit(deva, newa, xlit)
	self:equals('<span class="Deva" lang="new">[[' .. deva .. '#Newar|' .. deva .. ']]</span>',
		transliterate(deva, 'new', 'Deva'),
		newa,
		options)
end

function tests:test_translit_newa()
	local examples = {
		{ 'न्ह', '𑐤' },
		{ 'ङ्ह', '𑐓' },
		{ 'र्ह', '𑐭' },
		{ 'ल्ह', '𑐯' },
		{ 'म्ह', '𑐪' },
		{ 'ञ्ह', '𑐙' },
	}
	self:iterate(examples, 'do_test_translit')
end
 
return tests