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

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

local function link(word)
	return '<span class="Beng" lang="bn">[[' .. word .. '#Bengali|' .. word .. ']]</span>'
end

function tests:do_test_translit(beng, roman, xlit)
	return self:equals(link(beng), bn_translit.tr(beng, 'bn', 'Beng', 'debug'), roman)
end

function tests:test_translit_bengali()
	local examples = {
		{ 'ত্বক', 'tok' },
		{ 'ঠ্যাং', 'ṭhêṅ' },
		{ 'মানচিত্র', 'mancitro' },
		{ 'সূত্র', 'śutro' },
		{ 'মই', 'moi' },
		{ 'কারখানা', 'karkhana' },
		{ 'দুঃখিত', 'dukkhito' },
		{ 'লেবানন', 'lebanon' },
		{ 'যন্ত্রমানব', 'jontromanob' },
		{ 'প্রতিবেশী', 'protibeśi' },
	    { 'রচনা', 'rocona' },
		{ 'অংগুষ্ঠানা', 'oṅguśṭhana' },
		{ 'পানি', 'pani' },
		{ 'আগুন', 'agun' },
		{ 'পশ্চিমবঙ্গ', 'pościmboṅgo' },
		{ 'বাংলা', 'baṅla' },
	    { 'সর্বনাম', 'śorbonam' },
	    { 'ইতিহাস', 'itihaś' },
	    { 'শুভ', 'śubho' },
	    { 'শুদ্ধ', 'śuddho' },
	    { 'জল', 'jol' },
	    { 'তদ্ভব', 'todbhobo' },
	    { 'তৎসম', 'totśomo' },
	    { 'পশ্চিম', 'pościm' },
	    { 'পছন্দ', 'pochondo' },
	    { 'জন্মদিন', 'jonmodin' },
	    { 'অসভ্য', 'ośobbho' },
	    { 'প্রাণ', 'pran' },
	    { 'ক্ষুদ্র', 'khudro' },
	    { 'অক্ষর', 'okkhor' },
	    { 'জ্ঞান', 'gên' },
	    { 'বিজ্ঞান', 'biggên' },
	    { 'ওয়াদা', 'ōẇada' },
	    { 'বর্ষ', 'borśo' },
	    { 'আখতার', 'akhtar' },
	    { 'পঙ্কজ', 'ponkoj' },
	}
	self:iterate(examples, "do_test_translit")
end
 
return tests