Module:new-Newa-translit/testcases

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

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_newari:
Passed𑐣𑐾𑐥𑐵𑐮 𑐨𑐵𑐲𑐵nepāla bhāṣānepāla bhāṣā
Passed𑐳𑑂𑐎𑐩𑑂𑐨skambhaskambha

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

--TO DO
function tests:do_test_translit(sans, roman, xlit)
	return self:equals('<span class="Newa" lang="new">[[' .. sans .. '#Newari|' .. sans .. ']]</span>', new_translit.tr(sans, 'new', 'Newa'), roman)
end

function tests:test_translit_newari()
	local examples = {
		{ '𑐣𑐾𑐥𑐵𑐮 𑐨𑐵𑐲𑐵', 'nepāla bhāṣā' },
		{ '𑐳𑑂𑐎𑐩𑑂𑐨', 'skambha' },
	}
	return self:iterate(examples, "do_test_translit")
end
 
return tests