Module:hi-IPA/sandbox/testcases
< Module:hi-IPA | sandbox
- This module sandbox lacks a documentation subpage. Please create it.
- Useful links: root page • root page’s subpages • links • transclusions • tested module • sandbox of (diff)
local tests = require("Module:UnitTests")
local m_IPA = require("Module:hi-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.toIPA(term, "persianized")),
tag_IPA(expected),
{ comment = comment }
)
end
function tests:test_all()
examples = {
{ "kalya", "kəl.jɑ(ː)"},
}
--[[ Copy the following to add more examples:
{ "", "" },
]]
tests:iterate(examples, "check_output")
end
return tests