Module:ug-common/testcases

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

All tests passed. (refresh)

TextExpectedActualDiffers atComments
test_checkCommon:
Passedئۇئ
ۇ
ئ
ۇ
Passedدوختۇردوخت
ۇ
ر
دوخت
ۇ
ر
Passedكەپتەرخاناكەپتەرخان
ا
كەپتەرخان
ا
Passedجۇڭخۇاجۇڭخ
ۇا
جۇڭخ
ۇا
Passedئالماbackback
Passedبىلىمfrontfront

-- Unit tests for [[Module:ug-common]].
local p = require('Module:UnitTests')
local m = require('Module:ug-common')

function p:test_checkCommon()
	--getlast
	local base, v, c = m.getLast("ئۇ")
	self:equals("ئۇ", base .. "<br>" .. v .. "<br>" .. c , "ئ<br>ۇ<br>")
	local base, v, c = m.getLast("دوختۇر")
	self:equals("دوختۇر", base .. "<br>" .. v .. "<br>" .. c , "دوخت<br>ۇ<br>ر")
	local base, v, c = m.getLast("كەپتەرخانا")
	self:equals("كەپتەرخانا", base .. "<br>" .. v .. "<br>" .. c , "كەپتەرخان<br>ا<br>")
	local base, v, c = m.getLast("جۇڭخۇا")
	self:equals("جۇڭخۇا", base .. "<br>" .. v .. "<br>" .. c , "جۇڭخ<br>ۇا<br>")
	local base, v, c = m.getLast("a:bcde")
	if v then
		self:equals("a:bcde", base .. "<br>" .. v .. "<br>" .. c , "<br><br>")
	end
	
	--checkTongue
	local ttt = m.checkTongue("ئالما")
	self:equals("ئالما", ttt, "back")
	ttt = m.checkCentral("بىلىم")
	self:equals("بىلىم", ttt, "front")
end

return p