Module:User:Oyunqi/ug-common/testcases

-- 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