Module:User:Oyunqi/ug-common/testcases

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

1 of 80 tests failed. (refresh)

TextExpectedActual
test_last:
Passedقويوو
Passedقوييي
Passedناناا
Passedناننن
Passedئەخمەقەە
Passedئەخمەققق
Passedئىككىىى
Passedئىككى
Passedدەزمالاا
Passedدەزماللل
Passedئائىلەەە
Passedئائىلە
Passedپەيتونوو
Passedپەيتوننن
Passedتراكتوروو
Passedتراكتوررر
Passedئۈچۈۈ
Passedئۈچچچ
Passedئوتۇنۇۇ
Passedئوتۇننن
Passedتاغاا
Passedتاغغغ
Passedدوستوو
Passedدوستتت
Passedجۇڭخۇااا
Passedجۇڭخۇا
Passedگۇاڭجۇۇۇ
Passedگۇاڭجۇ
Passedئۇۇۇ
Passedئۇ
Passedئالمااا
Passedئالما
Passedباغاا
Passedباغغغ
Passedكالااا
Passedكالا
Passedدوستلۇقۇۇ
Passedدوستلۇققق
Passedبىلىمىى
Passedبىلىممم
TextExpectedActual
test_plural:
Script error during testing: bad argument #1 to 'match' (string expected, got nil)
stack traceback:
	[C]: ?
	[C]: in function 'v'
	mw.ustring.lua:84: in function 'match'
	Module:User:Oyunqi/ug-common:88: in function 'getPlural'
	Module:User:Oyunqi/ug-common/testcases:27: in function <Module:User:Oyunqi/ug-common/testcases:24>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:894: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
TextExpectedActual
test_syllables:
Passedقويقويقوي
Passedقوي11
Passedنانناننان
Passedنان11
Passedئەخمەقئەخ:مەقئەخ:مەق
Passedئەخمەق22
Passedئىككىئىك:كىئىك:كى
Passedئىككى22
Passedدەزمالدەز:مالدەز:مال
Passedدەزمال22
Passedئائىلەئا:ئى:لەئا:ئى:لە
Passedئائىلە33
Passedپەيتونپەي:تونپەي:تون
Passedپەيتون22
Passedتراكتورتراك:تورتراك:تور
Passedتراكتور22
Passedئۈچئۈچئۈچ
Passedئۈچ11
Passedئوتۇنئو:تۇنئو:تۇن
Passedئوتۇن22
Passedتاغتاغتاغ
Passedتاغ11
Passedدوستدوستدوست
Passedدوست11
Passedجۇڭخۇاجۇڭ:خۇاجۇڭ:خۇا
Passedجۇڭخۇا22
Passedگۇاڭجۇگۇاڭ:جۇگۇاڭ:جۇ
Passedگۇاڭجۇ22
Passedئۇئۇئۇ
Passedئۇ11
Passedئالمائال:مائال:ما
Passedئالما22
Passedباغباغباغ
Passedباغ11
Passedكالاكا:لاكا:لا
Passedكالا22
Passedدوستلۇقدوست:لۇقدوست:لۇق
Passedدوستلۇق22
Passedبىلىمبى:لىمبى:لىم
Passedبىلىم22

-- Unit tests for [[Module:User:Oyunqi/ug-common]].
local p = require('Module:UnitTests')
local m = require('Module:User:Oyunqi/ug-common')
local test_nouns = require('Module:User:Oyunqi/ug-common/testcases/data')

function p:test_syllables()
	local temp = ""
	for name, data in pairs(test_nouns) do
		temp = m.syllables(name)
		self:equals(name, table.concat(temp,":"), data.syllables)
		self:equals(name, #temp, data.cnt)
	end
end

function p:test_last()
	local temp = ""
	for name, data in pairs(test_nouns) do
		temp = m.getLast(name)
		self:equals(name, temp.lastv, data.lastv)
		self:equals(name, temp.lastc, data.lastc)
	end
end

function p:test_plural()
	local temp = ''
	for name, data in pairs(test_nouns) do
		temp = m.getPlural(name)
		self:equals(name, temp, data.plural)
		-- self:equals(name, temp.lip .. "&" .. temp.tongue, data.lastv_lip .. "&" .. data.lastv_tongue)
	end
	
end

function p:all()
	self:syllables()
end

return p