Module:Ethi-common/testcases

local tests = require('Module:UnitTests') local ethi_common = require('Module: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), ethi_common.from_components(components), ethi) end

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

return tests