Jump to content

Module:ks-translit/testcases

From Wiktionary, the free dictionary

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

4 of 4 tests failed. (refresh)

TextExpectedActualDiffers at
test_translit_ks:
Failedच़tsaच़1
Failedकॉशुरkoshurकॉशुर1
Failedजहाज़jahāzजहाज़1
Failedबादाम्bādāmबादाम्1

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

function tests:do_test_translit(deva, roman, xlit)
	self:equals('<span class="Deva" lang="ks">[[' .. mw.ustring.gsub(deva, "%+", "") .. '#Kashmiri|' .. mw.ustring.gsub(deva, "%+", "") .. ']]</span>', ks_translit.tr(deva, 'ks', 'Deva'), roman)
end

function tests:test_translit_ks()	
	self:do_test_translit('च़','tsa')
	self:do_test_translit('कॉशुर','koshur')
	self:do_test_translit('जहाज़','jahāz')
	self:do_test_translit('बादाम्','bādām')
end
 
return tests