Jump to content

Module:new-translit/testcases

From Wiktionary, the free dictionary

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_newari:
Passedनेवाः भाय्newā: bhænewā: bhæ
Passedसर्गःsarga:sarga:
Passedसँक्वःsãkwa:sãkwa:
Passedप्याखंpyākhaṃpyākhaṃ
Passedनवःघाँय्nawa:ghæ̃nawa:ghæ̃
Passedछेँchẽchẽ

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

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

function tests:test_translit_newari()
	local examples = {
		{ 'नेवाः भाय्', 'newā: bhæ' },
		{ 'सर्गः', 'sarga:' },
		{ 'सँक्वः', 'sãkwa:' },
		{ 'प्याखं', 'pyākhaṃ' },
		{ 'नवःघाँय्', 'nawa:ghæ̃' },
		{ 'छेँ', 'chẽ' },
	}
	return self:iterate(examples, "do_test_translit")
end
 
return tests