Module:Deva-Kthi-translit/testcases

From Wiktionary, the free dictionary
Jump to navigation Jump to search

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_kaithi:
Passedठाँव𑂘𑂰𑂀𑂫𑂘𑂰𑂀𑂫
Passedठाँ𑂘𑂰𑂀𑂘𑂰𑂀
Passedसुग्गा𑂮𑂳𑂏𑂹𑂏𑂰𑂮𑂳𑂏𑂹𑂏𑂰
Passedलिंगानुपात𑂪𑂱𑂁𑂏𑂰𑂢𑂳𑂣𑂰𑂞𑂪𑂱𑂁𑂏𑂰𑂢𑂳𑂣𑂰𑂞
Passedगईल𑂏𑂆𑂪𑂏𑂆𑂪

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

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

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

function tests:test_translit_kaithi()
	local examples = {
		{ 'ठाँव', '𑂘𑂰𑂀𑂫' },
		{ 'ठाँ', '𑂘𑂰𑂀' },
		{ 'सुग्गा', '𑂮𑂳𑂏𑂹𑂏𑂰' },
		{ 'लिंगानुपात', '𑂪𑂱𑂁𑂏𑂰𑂢𑂳𑂣𑂰𑂞' },
		{ 'गईल', '𑂏𑂆𑂪' },

	}
	self:iterate(examples, 'do_test_translit')
end
 
return tests