Module:si-IPA/testcases
Appearance
- The following documentation is located at Module:si-IPA/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
4 of 4 tests failed. (refresh)
Text | Expected | Actual | Comments | |
---|---|---|---|---|
කරනවා (karanawā) | kərənəwa | kərən̪əʋaː | ||
ශ්රී ලංකා (śrī laṁkā) | ʃriː ləŋkaː | ʃə.riː ləm̃kaː | ||
සිංහල (siṁhala) | siŋhələ | sim̃hələ | ||
සංස්කෘත (saṁskr̥ta) | səŋskrutə | səm̃sə.krut̪ə |
local tests = require("Module:UnitTests")
local m_IPA = require("Module:si-IPA")
local function tag_IPA(IPA)
return '<span class="IPA">' .. IPA .. '</span>'
end
function tests:check_output(term, expected, comment)
self:equals(
m_IPA.link(term),
tag_IPA(m_IPA.to_IPA(term)[1]),
tag_IPA(expected),
{ comment = comment }
)
end
function tests:test_all()
examples = {
{ "කරනවා", "kərənəwa"},
{ "ශ්රී ලංකා", "ʃriː ləŋkaː"},
{ "සිංහල", "siŋhələ"},
{ "සංස්කෘත", "səŋskrutə"},
}
--[[ Copy the following to add more examples:
{ "", "" },
]]
tests:iterate(examples, "check_output")
end
return tests