Module:kn-translit/testcases

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

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

1 of 4 tests failed. (refresh)

TextExpectedActualDiffers at
test_translit_kannada:
Passedಲಲlalalala
Passedಅಗ್ನಿagniagni
Passedಪಡಿಯಚ್ಚುpaḍiyaccupaḍiyaccu
Failedಕೢಪ್ತkl̥ptakaೢpta2

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

function tests:check_translit(Knda, roman)
	self:equals('<span class="Knda mention" lang="kn">[[' .. Knda .. '#Knda|' .. Knda .. ']]</span>', kn_translit.tr(Knda, 'kn', 'Knda'), roman)
end

function tests:test_translit_kannada()
	self:check_translit('ಲಲ', 'lala')
	self:check_translit('ಅಗ್ನಿ', 'agni')
	self:check_translit('ಪಡಿಯಚ್ಚು', 'paḍiyaccu')
	self:check_translit('ಕೢಪ್ತ', 'kl̥pta')
end
 
return tests