Module:User:iwsfutcmd/Ethi-common/testcases

local tests = require('Module:UnitTests') local ethi_common = require('Module:User:iwsfutcmd/Ethi-common')

function tests:check_components(ethi, expected_components) local components = ethi_common.to_components(ethi) self:equals_deep(" " .. ethi .. " ", components, expected_components) self:equals_deep("base= " .. components.base .. ", order=" .. components.order ..                        ", labiovelar=" .. tostring(components.labiovelar) .. ", palatalized=" ..                         tostring(components.palatalized) .. ", alt=" .. tostring(components.alt) .. ", geminate=" ..                         tostring(components.geminate), ethi_common.from_components(components), ethi) end

function tests:test_components local examples = {{"ጩ", { base = "ጨ", order = 2, labiovelar = false, palatalized = false, alt = false, geminate = false }}, {"ዧ", { base = "ዠ", order = 4, labiovelar = true, palatalized = false, alt = false, geminate = false }}, {"ኊ", { base = "ኀ", order = 3, labiovelar = true, palatalized = false, alt = false, geminate = false }}, {"ኯ", { base = "ከ", order = 4, labiovelar = true, palatalized = false, alt = true, geminate = false }}, {"ፙ", { base = "መ", order = 1, labiovelar = false, palatalized = true, alt = false, geminate = false }}, {"ሎ፟", { base = "ለ", order = 7, labiovelar = false, palatalized = false, alt = false, geminate = true }}}   self:iterate(examples, "check_components") end

return tests