Module:Ethi-common/testcases
Appearance
- The following documentation is located at Module:Ethi-common/testcases/documentation. [edit] Categories were auto-generated by Module:module categorization. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • sandbox
All tests passed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
ጩ | {alt=false, base="ጨ", labiovelar=false, order=2, palatalized=false} | {alt=false, base="ጨ", labiovelar=false, order=2, palatalized=false} | |
base=ጨ, order=2, labiovelar=false, palatalized=false, alt=false | "ጩ" | "ጩ" | |
ዧ | {alt=false, base="ዠ", labiovelar=true, order=4, palatalized=false} | {alt=false, base="ዠ", labiovelar=true, order=4, palatalized=false} | |
base=ዠ, order=4, labiovelar=true, palatalized=false, alt=false | "ዧ" | "ዧ" | |
ኊ | {alt=false, base="ኀ", labiovelar=true, order=3, palatalized=false} | {alt=false, base="ኀ", labiovelar=true, order=3, palatalized=false} | |
base=ኀ, order=3, labiovelar=true, palatalized=false, alt=false | "ኊ" | "ኊ" | |
ኯ | {alt=true, base="ከ", labiovelar=true, order=4, palatalized=false} | {alt=true, base="ከ", labiovelar=true, order=4, palatalized=false} | |
base=ከ, order=4, labiovelar=true, palatalized=false, alt=true | "ኯ" | "ኯ" | |
ፙ | {alt=false, base="መ", labiovelar=false, order=1, palatalized=true} | {alt=false, base="መ", labiovelar=false, order=1, palatalized=true} | |
base=መ, order=1, labiovelar=false, palatalized=true, alt=false | "ፙ" | "ፙ" |
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