Module:tl-translit/testcases

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

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

All tests passed. (refresh)

TextExpectedActual
test_translit_tagalog:
Passedᜀᜋamaama
Passedᜇᜒᜏdiwadiwa
Passedᜇᜓᜄᜓdugudugu
Passedᜐᜎsalasala
Passedᜉᜀpaapaa
Passedᜅᜎᜈ᜔ngalanngalan
Passedᜎᜑᜆ᜔lahatlahat
Passedᜐᜇᜒᜏsariwasariwa
Passedᜉᜄ᜔ᜁᜊᜒᜄ᜔pag-ibigpag-ibig
Passedᜐᜋ ᜈᜅ᜔ ᜎᜓᜂᜊ᜔sama nang luubsama nang luub

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

--TO DO
function tests:do_test_translit(tgl, roman, xlit)
	self:equals('<span class="Tglg" lang="tl">[[' .. tgl .. '#Tagalog|' .. tgl .. ']]</span>', tl_translit.tr(tgl, 'tl', 'Tglg'), roman)
end

function tests:test_translit_tagalog()
	self:do_test_translit('ᜀᜋ', 'ama')
	self:do_test_translit('ᜇᜒᜏ', 'diwa')
	self:do_test_translit('ᜇᜓᜄᜓ', 'dugu')
	self:do_test_translit('ᜐᜎ', 'sala')
    self:do_test_translit('ᜉᜀ', 'paa')
	self:do_test_translit('ᜅᜎᜈ᜔', 'ngalan')
	self:do_test_translit('ᜎᜑᜆ᜔', 'lahat')
	self:do_test_translit('ᜐᜇᜒᜏ', 'sariwa')
	self:do_test_translit('ᜉᜄ᜔ᜁᜊᜒᜄ᜔', 'pag-ibig')
	self:do_test_translit('ᜐᜋ ᜈᜅ᜔ ᜎᜓᜂᜊ᜔', 'sama nang luub')

end
 
return tests