Module:Sidd-translit/testcases

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

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_siddham:
Passed𑖢𑖲𑖨𑖯𑖡purānapurāna
Passed𑖎𑖡𑖿𑖝kantakanta
Passed𑖎𑖜𑖿𑖜kaṇṇakaṇṇa
Passed𑖭𑖦𑖯𑖂𑖀samāiasamāia
Passed𑖀𑖦𑖰𑖗amiñaamiña
Passed𑖝𑖲𑖕𑖿𑖖𑖲tujjhutujjhu
Passed𑖎𑖮𑖡𑖿𑖝𑖸kahantekahante

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

local full_link = require('Module:links').full_link
local sa = require('Module:languages').getByCode('sa')

--TO DO
function tests:do_test_translit(siddham, roman)
	self:equals(siddham, sidd_translit.tr(siddham, 'sa', 'Sidd'), roman)
end

function tests:test_translit_siddham()
	local examples = {
		{'𑖢𑖲𑖨𑖯𑖡', 'purāna'},
		{'𑖎𑖡𑖿𑖝', 'kanta'},
		{'𑖎𑖜𑖿𑖜', 'kaṇṇa'},
		{'𑖭𑖦𑖯𑖂𑖀', 'samāia'},
		{'𑖀𑖦𑖰𑖗', 'amiña'},
		{'𑖝𑖲𑖕𑖿𑖖𑖲', 'tujjhu'},
		{'𑖎𑖮𑖡𑖿𑖝𑖸', 'kahante'},
	}
	
	self:iterate(examples, "do_test_translit")
end
 
return tests