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

All tests passed. (refresh)

Text Expected Actual Differs at
test_translit_sanskrit:
Passed वाक् vāk vāk
Passed वाक vāka vāka
Passed अदृष्ट adṛṣṭa adṛṣṭa
Passed सोऽहम् so’ham so’ham
Passed दुःख duḥkha duḥkha

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

--TO DO
function tests:do_test_translit(sans, roman, xlit)
	self:equals('<span class="Deva" lang="sa">[[' .. sans .. '#Sanskrit|' .. sans .. ']]</span>', sa_translit.tr(sans, 'sa', 'Deva'), roman)
end

function tests:test_translit_sanskrit()
	self:do_test_translit('वाक्', 'vāk')
	self:do_test_translit('वाक', 'vāka')
	self:do_test_translit('अदृष्ट', 'adṛṣṭa')
	self:do_test_translit('सोऽहम्', 'so’ham')
	self:do_test_translit('दुःख', 'duḥkha')
end
 
return tests