Module:User:Erutuon/syllables/sandbox/testcases
Appearance
- The following documentation is located at Module:User:Erutuon/syllables/sandbox/testcases/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • sandbox of
Module error: No such module "syllables/sandbox/testcases".
local tests = require("Module:UnitTests")
local m_syllables = require("Module:syllables/sandbox")
local function tag(IPA)
return '<span class="IPA">' .. IPA .. '</span>'
end
function tests:check(example, expected)
self:equals(
tag(example),
m_syllables.count(example),
expected
)
end
function tests:test()
local examples = {
{ "ðɛɹ", 1 },
{ "ðɛɚ", 2 },
{ "ðɛɚ̯", 1 },
}
tests:iterate(examples, "check")
end
return tests