Module:User:Oyunqi/ug-common2/testcases
- The following documentation is located at Module:User:Oyunqi/ug-common2/testcases/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • user page • user talk page • userspace
1 of 27 tests failed. (refresh)
Text | Expected | Actual | Differs at | Comments | |
---|---|---|---|---|---|
![]() | پېئىل | back | back | ||
![]() | بىلىم | front | front |
Text | Expected | Actual | Differs at | Comments | |
---|---|---|---|---|---|
open auto | |||||
![]() | بالا | بالىلار | بالىلار | {{ug-headword}} | |
![]() | ئالما | ئالمىلار | ئالمىلار | {{ug-headword}} | |
![]() | ئائىلە | ئائىلىلەر | ئائىلىلەر | {{ug-headword}} | |
![]() | ئۇ | ئۇلار | ئۇلار | {{ug-headword}} | |
![]() | ئىككى | ئىككىلەر | ئىككىلەر | {{ug-headword}} | |
open no change | |||||
![]() | بالا | بالالار | بالالار | {{ug-headword|change=no}} | |
close auto | |||||
![]() | نان | نانلار | نانلار | {{ug-headword}} | |
![]() | تاغ | تاغلار | تاغلار | {{ug-headword}} | |
![]() | قوي | قويلار | قويلار | {{ug-headword}} | |
![]() | گۈل | گۈللەر | گۈللەر | {{ug-headword}} | |
![]() | دەزمال | دەزماللار | دەزماللار | {{ug-headword}} | |
![]() | پەيتون | پەيتونلار | پەيتونلار | {{ug-headword}} | |
![]() | ئوتۇن | ئوتۇنلار | ئوتۇنلار | {{ug-headword}} | |
![]() | ئەخمەق | ئەخمەقلەر | ئەخمەقلەر | {{ug-headword}} | |
ending with چە | |||||
![]() | زىخچە | زىخچىلار | زىخچىلار | {{ug-headword}} | |
![]() | قىرغىزچە | قىرغىزچىلار | قىرغىزچىلار | {{ug-headword}} | |
![]() | ئۈنچە | ئۈنچىلەر | ئۈنچىلەر | {{ug-headword}} | |
![]() | غۇنچە | غۇنچىلار | غۇنچىلار | {{ug-headword}} | |
central auto | |||||
![]() | بىخ | بىخلار | بىخلار | {{ug-headword}} | |
![]() | تىل | تىللار | تىللار | {{ug-headword}} | |
nouns exception auto | |||||
![]() | بىلىم | بىلىملەر | بىلىملەر | {{ug-headword}} | |
![]() | ئىلىم | ئىلىملەر | ئىلىملەر | {{ug-headword}} | |
![]() | تىز | تىزلار | تىزلار | {{ug-headword}} | |
![]() | پېئىل | پېئىللار | پېئىللار | {{ug-headword}} | |
![]() | ۋېلسىپىت | ۋېلسىپىتلار | (nil) | N/A | {{ug-headword}} |
Lua error in Module:module_categorization at line 298: Could not infer any languages or scripts from root pagename 'User:Oyunqi'
-- Unit tests for [[Module:User:Oyunqi/ug-common2]].
local p = require('Module:UnitTests')
local m = require('Module:User:Oyunqi/ug-common2')
local m2 = require('Module:User:Oyunqi/ug-headword2')
local test_nouns = require('Module:User:Oyunqi/ug-common/testcases/data')
--local test_nouns2 = require('Module:User:Oyunqi/ug-common2/testcases/data2')
local test_nouns2 = require('Module:ug-common/testcases/data')
function p:make_plural_noun(singular, vv)
local base, v, c = m.getLast(singular)
vv = vv or v
local term = base .. vv .. c
local tongue = m.checkTongue(singular)
if tongue == "front" then
return term .. "لەر"
elseif tongue == "back" then
return term .. "لار"
end
return nil
end
local function link(word)
return "[[" .. word .. "#Uyghur|" .. word .. "]]"
end
local function get_Tempalte(vv, change)
local par = ""
if vv and vv ~= "" then par = par .. "|" .. vv end
if change and change ~= "" then par = par .. "|change=" .. change end
str = "<code><b>{{ug-headword".. mw.text.nowiki(par) .."}}</b></code>"
return str
end
local function get_params(params)
local par = {}
params = mw.ustring.gsub(params, "|", " ")
i=1
for token in mw.ustring.gmatch(params,"[^%s]+") do
t = mw.ustring.gsub(token, "=", " ")
j =1
ts={}
for tt in mw.ustring.gmatch(t,"[^%s]+") do
ts[j]=tt
j=j+1
end
if j ==3 then
par[ts[1]] =ts[2]
else
par[i] = ts[1]
i=i+1
end
end
return par
end
function p:check_noun_plurals(singular, expected_plural)
if expected_plural.plural then
local params = {}
if expected_plural.params then
params = get_params(expected_plural.params)
end
local change = params["change"] or "yes"
local vv = params[1]
local test = m2.make_plural_noun(singular, vv, change)
local comment = get_Tempalte(vv, change)
self:equals(link(singular),
test,
expected_plural.plural,
{comment = get_Tempalte(params[1], params["change"])})
end
end
function p:test_checkWord2()
p:iterate(test_nouns2, "check_noun_plurals")
end
function p:test_checkCentral()
local ttt = m.checkCentral("پېئىل")
self:equals("پېئىل", ttt, "back")
ttt = m.checkCentral("بىلىم")
self:equals("بىلىم", ttt, "front")
end
function p:ttest_checkWord()
--getlast
local base, v, c = m.getLast("جۇڭخۇا")
self:equals("جۇڭخۇا", base .. "-" .. v .. "-" .. c , "جۇڭخ-ۇا-")
--check
local ttt = m.checkTongue("ئالما")
--local ttt = m.checkFrontBack("ئالما")
self:equals("ئالما", ttt, "back")
ttt = m.checkCentral("بىلىم")
self:equals("بىلىم", ttt, "front")
local pl = self:make_plural_noun("ئالما","ى")
self:equals("ئالما", pl, "ئالمىلار")
--head
pl = m2.make_plural_noun("ئالما","ى", "yes")
self:equals("ئالما", pl, "ئالمىلار")
--test all
for name, data in pairs(test_nouns) do
local plural = m2.make_plural_noun(name, "", "yes")
self:equals(name, plural, data.plural)
end
end
return p