Module:kgj-translit/testcases

Revision as of 12:45, 21 April 2026 by Sware (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:kgj-translit/testcases/doc

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

function tests:do_test_translit(deva, roman, comment)
	self:equals('<span class="Deva" lang="kgj">[[' .. mw.ustring.gsub(deva, "%+", "") .. '#Kham|' .. mw.ustring.gsub(deva, "%+", "") .. ']]</span>', kgj_translit.tr(deva, 'kgj', 'Deva'), roman, { comment = comment })
end

function tests:test_translit_kgj()
self:do_test_translit('ज़ा', 'zā')
self:do_test_translit('भ्लोङ', 'bhloṅ')
self:do_test_translit('ॱको', "ko'")
self:do_test_translit('ॱकाः', "kāḥ'")
self:do_test_translit('ॱक्या', "kyā'")
self:do_test_translit('ॱह्व़िँ', "hẏĩ'")
end
 
return tests