Module:Hoo-ipac/testcases: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 23: | Line 23: | ||
{"hi", "hi"}, | {"hi", "hi"}, | ||
{"fjåli", "fjuli"}, | {"fjåli", "fjuli"}, | ||
{"berna", "bɛʁna"}, | |||
} | } | ||
self:iterate(list, "check_phonetic") | self:iterate(list, "check_phonetic") | ||
Revision as of 17:28, 2 September 2025
This is a test case page of the code turning words from Hoofnur into their IPA transcription. This is based off of similar modules and pages from User:Sware.
The module is still a work in progress.
- The following documentation is located at Module:Hoo-ipac/testcases/doc.[edit]
- Useful links: root page • root page's subpages • links • transclusions • testcases • sandbox
All tests passed. (refresh)
| Text | Expected | Actual | |
|---|---|---|---|
| hi | hi | hi | |
| fjåli | fjuli | fjuli | |
| berna | bɛʁna | bɛʁna |
local tests = require('Module:UnitTests')
local m_IPA = require('Module:Hoo-ipac')
local function IPA_style(IPA)
return '<span style="font-size:110%;font-family:Gentium,\'DejaVu Sans\',\'Segoe UI\',sans-serif>' .. IPA .. '</span>'
end
local function link(term)
return '[[Contionary:' .. term .. "#Ayeri|" .. term .. ']]'
end
function tests:check_phonetic(term, expected)
return tests:equals(
link(term),
m_IPA.crux(term),
expected,
{ display = IPA_style, show_difference = true}
)
end
function tests:test_phonetic()
local list = {
{"hi", "hi"},
{"fjåli", "fjuli"},
{"berna", "bɛʁna"},
}
self:iterate(list, "check_phonetic")
end
return tests