Jump to content

Module:sa-translit/testcases

From Wiktionary, the free dictionary

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_translit_sanskrit:
Passedवाक्vākvāk
Passedवाकvākavāka
Passedअदृष्टadṛṣṭaadṛṣṭa
Passedसोऽहम्soʼhamsoʼham
Passedदुःखduḥkhaduḥkha
Passedकॢप्तkḷptakḷpta
Passedअरा॑यि॒ काणे॒ विक॑टे गि॒रिं ग॑च्छ सदान्वेárāyi kā́ṇe víkaṭe giríṃ gaccha sadānveárāyi kā́ṇe víkaṭe giríṃ gaccha sadānve
Passedअ॒ग्निमी॑ळेagnímīḷeagnímīḷe
Passedश्वे॒तो॑ऽरु॒षोśvetòʼruṣóśvetòʼruṣó
Passedअ॒रु॒षःaruṣáḥaruṣáḥ
Passedअणुगच्छइaṇugacchaïaṇugacchaï
Passedचट्टेइcaṭṭeicaṭṭei
Passedरइraïraï
Passedसउत्तीsaüttīsaüttī

-- 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')
	self:do_test_translit('कॢप्त', 'kḷpta')
	self:do_test_translit('अरा॑यि॒ काणे॒ विक॑टे गि॒रिं ग॑च्छ सदान्वे', 'árāyi kā́ṇe víkaṭe giríṃ gaccha sadānve')
	self:do_test_translit('अ॒ग्निमी॑ळे', 'agnímīḷe')
	self:do_test_translit('श्वे॒तो॑ऽरु॒षो', 'śvetòʼruṣó')
	self:do_test_translit('अ॒रु॒षः', 'aruṣáḥ')
	self:do_test_translit('अणुगच्छइ', 'aṇugacchaï')
	self:do_test_translit('चट्टेइ', 'caṭṭei')
	self:do_test_translit('रइ', 'raï')
	self:do_test_translit('सउत्ती', 'saüttī')
end
 
return tests