Module:qhv-pron/testcases: Difference between revisions
Jump to navigation
Jump to search
All tests passed. (refresh)
(Created page with "local tests = require('Module:UnitTests') local m_IPA = require('Module:qhv-pron') local function IPA_style(IPA) return '<span style="font-size:110%;font-family:Gentium,\'De...") |
No edit summary |
||
(19 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
end | end | ||
local function linkup(text) | local function linkup(text, noresp) | ||
return "[[Contionary:" .. text .. "#High Valyrian|" .. text .. "]]" | return "[[Contionary:" .. text .. "#High Valyrian|" .. text .. "]]" | ||
end | end | ||
function tests:check_output(term, expected) | function tests:check_output(term, expected, noresp) | ||
return tests:equals( | |||
noresp and linkup(noresp) .. "<br>(" .. term .. ")" or linkup(term), | |||
m_IPA.crux(term), | |||
expected, | |||
{ display = IPA_style } | |||
) | |||
end | |||
function tests:check_output2(term, expected) | |||
return tests:equals( | return tests:equals( | ||
linkup(term), | linkup(term), | ||
m_IPA. | m_IPA.antique_crux(term), | ||
expected, | expected, | ||
{ display = IPA_style } | { display = IPA_style } | ||
Line 19: | Line 28: | ||
end | end | ||
function tests: | function tests:test_modern() | ||
local list = { | local list = { | ||
{"drakarys", " | {"drakarys", "draˈkaɾys"}, | ||
{"valonqar", "vaˈloɴqar"}, | {"valonqar", "vaˈloɴqar"}, | ||
{"Thoros", "ˈθoɾos"}, | {"Thoros", "ˈθoɾos"}, | ||
{" | {"arákh", "aˈɾáx", "arakh"}, | ||
{"ēngos", "ˈeːŋɡos"}, | {"ēngos", "ˈeːŋɡos"}, | ||
{"amīvindigon", "amiːˈvindiɡon"}, | {"amīvindigon", "amiːˈvindiɡon"}, | ||
Line 30: | Line 39: | ||
{"pōja", "ˈpoːja"}, | {"pōja", "ˈpoːja"}, | ||
{"riña", "ˈriɲa"}, | {"riña", "ˈriɲa"}, | ||
{"zirȳla", " | {"zirȳla", "ziˈɾyːla"}, | ||
{"ipradis", "iˈpradis"}, | |||
{"rholagon", "ṛoˈlaɡon"}, | |||
} | } | ||
self:iterate(list, "check_output") | self:iterate(list, "check_output") | ||
end | |||
function tests:test_antique() | |||
local list = { | |||
{"vējōñe", "veːˈjoːɲe"}, | |||
{"vōljes", "ˈwoːʎes"}, | |||
{"vumbiarzy", "wumˈbi͜arzy"}, | |||
{"vȳs", "ɥyːs"}, | |||
{"ȳgha", "ˈyːɣa"}, | |||
{"vajie", "ˈɥaɟi͜e"}, | |||
{"vūjigon", "ˈwuːɟiɡon"}, | |||
{"qrillaodikio", "qrilˈlao̯diki͜o"}, | |||
} | |||
self:iterate(list, "check_output2") | |||
end | end | ||
return tests | return tests |
Latest revision as of 14:55, 1 July 2021
- The following documentation is located at Module:qhv-pron/testcases/doc.[edit]
- Useful links: root page • root page's subpages • links • transclusions • testcases • sandbox
All tests passed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
vējōñe | veːˈjoːɲe | veːˈjoːɲe | |
vōljes | ˈwoːʎes | ˈwoːʎes | |
vumbiarzy | wumˈbi͜arzy | wumˈbi͜arzy | |
vȳs | ɥyːs | ɥyːs | |
ȳgha | ˈyːɣa | ˈyːɣa | |
vajie | ˈɥaɟi͜e | ˈɥaɟi͜e | |
vūjigon | ˈwuːɟiɡon | ˈwuːɟiɡon | |
qrillaodikio | qrilˈlao̯diki͜o | qrilˈlao̯diki͜o |
Text | Expected | Actual | |
---|---|---|---|
drakarys | draˈkaɾys | draˈkaɾys | |
valonqar | vaˈloɴqar | vaˈloɴqar | |
Thoros | ˈθoɾos | ˈθoɾos | |
arakh (arákh) |
aˈɾáx | aˈɾáx | |
ēngos | ˈeːŋɡos | ˈeːŋɡos | |
amīvindigon | amiːˈvindiɡon | amiːˈvindiɡon | |
ojehiknon | ojeˈhiknon | ojeˈhiknon | |
pōja | ˈpoːja | ˈpoːja | |
riña | ˈriɲa | ˈriɲa | |
zirȳla | ziˈɾyːla | ziˈɾyːla | |
ipradis | iˈpradis | iˈpradis | |
rholagon | ṛoˈlaɡon | ṛoˈlaɡon |
local tests = require('Module:UnitTests')
local m_IPA = require('Module:qhv-pron')
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 linkup(text, noresp)
return "[[Contionary:" .. text .. "#High Valyrian|" .. text .. "]]"
end
function tests:check_output(term, expected, noresp)
return tests:equals(
noresp and linkup(noresp) .. "<br>(" .. term .. ")" or linkup(term),
m_IPA.crux(term),
expected,
{ display = IPA_style }
)
end
function tests:check_output2(term, expected)
return tests:equals(
linkup(term),
m_IPA.antique_crux(term),
expected,
{ display = IPA_style }
)
end
function tests:test_modern()
local list = {
{"drakarys", "draˈkaɾys"},
{"valonqar", "vaˈloɴqar"},
{"Thoros", "ˈθoɾos"},
{"arákh", "aˈɾáx", "arakh"},
{"ēngos", "ˈeːŋɡos"},
{"amīvindigon", "amiːˈvindiɡon"},
{"ojehiknon", "ojeˈhiknon"},
{"pōja", "ˈpoːja"},
{"riña", "ˈriɲa"},
{"zirȳla", "ziˈɾyːla"},
{"ipradis", "iˈpradis"},
{"rholagon", "ṛoˈlaɡon"},
}
self:iterate(list, "check_output")
end
function tests:test_antique()
local list = {
{"vējōñe", "veːˈjoːɲe"},
{"vōljes", "ˈwoːʎes"},
{"vumbiarzy", "wumˈbi͜arzy"},
{"vȳs", "ɥyːs"},
{"ȳgha", "ˈyːɣa"},
{"vajie", "ˈɥaɟi͜e"},
{"vūjigon", "ˈwuːɟiɡon"},
{"qrillaodikio", "qrilˈlao̯diki͜o"},
}
self:iterate(list, "check_output2")
end
return tests