Module:siwa-pron/testcases: Difference between revisions
Jump to navigation
Jump to search
1 test failed. (refresh)
(Created page with "local tests = require('Module:UnitTests') function tests:test_example() --here be the tests end return tests") |
No edit summary |
||
Line 1: | Line 1: | ||
local tests = require('Module:UnitTests') | local tests = require('Module:UnitTests') | ||
local m_IPA = require('Module:siwa-pron') | |||
local function tag_IPA(IPA) | |||
return '<span style="font-size:110%;font-family:Gentium,\'DejaVu Sans\',\'Segoe UI\',sans-serif>' .. IPA .. '</span>' | |||
end | |||
function tests:check_output(term, expected) | |||
return tests:equals( | |||
"[[Contionary:" .. term .. "#Siwa|" .. term .. "]]", | |||
m_IPA.quid(term), | |||
expected, | |||
{ display = tag_IPA } | |||
) | |||
end | |||
function tests:test_example() | function tests:test_example() | ||
local list = { | |||
{"kigįni", "ˈcʰijːini"}, | |||
{"gedli", "ˈɟetɬi"}, | |||
{"poaṡṡi", "ˈpʰɔɑɕːi"}, | |||
{"katsa", "ˈkʰɑtsa"}, | |||
{"dảdna", "ˈdæːʔt̚na"}, | |||
{"dảnaka", "ˈdæːnɑɡa"}, | |||
{"kęmes", "ˈcʰæmɛs"}, | |||
{"pilra", "ˈpɪlra"}, | |||
{"tygi", "ˈtʰyɟi"}, | |||
{"ymni", "ˈœmnːi"}, | |||
{"tsġiauga", "ˈtsxiɑuɣa"}, | |||
{"huoibmui", "ˈhʊɔɪʔp̚mui"}, | |||
{"mamma", "ˈmɑmːa"}, | |||
{"hįůdįa", "ˈhjød͡ʑa"}, | |||
{"tỏ", "ˈtʰʊː"}, | |||
{"gįosin", "ˈɟɔsɪn"}, | |||
{"kika", "ˈcʰika"}, | |||
{"tsepu", "ˈt͡sepu"}, | |||
{"huhhi", "ˈhuhːi"}, | |||
{"tůppů", "ˈtʰœʔpø"}, | |||
{"sauṡpỉdna", "ˈsaʊɕpiːʔt̚na"}, | |||
{"voakna", "ˈvɔaʔk̚ŋa"}, | |||
{"toḥḥami", "ˈtʰɔʔːɑmi"}, | |||
{"oddo", "ˈɔtːɔ"}, | |||
{"niḍgi", "ˈnɪðɟi"}, | |||
{"nedġi", "ˈnɛðxi"}, | |||
{"Teltsġvi", "ˈtʰɛɬt͡sxwi"}, | |||
{"uįokỏesġen", "ˌujɔˈkʰʊːɛsxɛn"}, | |||
{"hait", "ˈhaɪʔɪ"}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
{"", ""}, | |||
} | |||
self:iterate(list, "check_output") | |||
end | end | ||
return tests | return tests |
Revision as of 16:14, 1 January 2021
- The following documentation is located at Module:siwa-pron/testcases/doc.[edit]
- Useful links: root page • root page's subpages • links • transclusions • testcases • sandbox
1 test failed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
Script error during testing: Module:siwa-pron/testcases:11: attempt to call field 'quid' (a nil value)stack traceback: Module:siwa-pron/testcases:11: in function 'func' Module:UnitTests:247: in function 'iterate' Module:siwa-pron/testcases:71: in function <Module:siwa-pron/testcases:17> (tail call): ? [C]: in function 'xpcall' Module:UnitTests:299: in function <Module:UnitTests:261> (tail call): ? mw.lua:527: in function <mw.lua:507> (tail call): ? [C]: in function 'xpcall' ...cribunto/includes/engines/LuaStandalone/MWServer.lua:99: in function 'handleCall' ...cribunto/includes/engines/LuaStandalone/MWServer.lua:313: in function 'dispatch' ...cribunto/includes/engines/LuaStandalone/MWServer.lua:52: in function 'execute' ...Scribunto/includes/engines/LuaStandalone/mw_main.lua:7: in main chunk [C]: ? |
local tests = require('Module:UnitTests')
local m_IPA = require('Module:siwa-pron')
local function tag_IPA(IPA)
return '<span style="font-size:110%;font-family:Gentium,\'DejaVu Sans\',\'Segoe UI\',sans-serif>' .. IPA .. '</span>'
end
function tests:check_output(term, expected)
return tests:equals(
"[[Contionary:" .. term .. "#Siwa|" .. term .. "]]",
m_IPA.quid(term),
expected,
{ display = tag_IPA }
)
end
function tests:test_example()
local list = {
{"kigįni", "ˈcʰijːini"},
{"gedli", "ˈɟetɬi"},
{"poaṡṡi", "ˈpʰɔɑɕːi"},
{"katsa", "ˈkʰɑtsa"},
{"dảdna", "ˈdæːʔt̚na"},
{"dảnaka", "ˈdæːnɑɡa"},
{"kęmes", "ˈcʰæmɛs"},
{"pilra", "ˈpɪlra"},
{"tygi", "ˈtʰyɟi"},
{"ymni", "ˈœmnːi"},
{"tsġiauga", "ˈtsxiɑuɣa"},
{"huoibmui", "ˈhʊɔɪʔp̚mui"},
{"mamma", "ˈmɑmːa"},
{"hįůdįa", "ˈhjød͡ʑa"},
{"tỏ", "ˈtʰʊː"},
{"gįosin", "ˈɟɔsɪn"},
{"kika", "ˈcʰika"},
{"tsepu", "ˈt͡sepu"},
{"huhhi", "ˈhuhːi"},
{"tůppů", "ˈtʰœʔpø"},
{"sauṡpỉdna", "ˈsaʊɕpiːʔt̚na"},
{"voakna", "ˈvɔaʔk̚ŋa"},
{"toḥḥami", "ˈtʰɔʔːɑmi"},
{"oddo", "ˈɔtːɔ"},
{"niḍgi", "ˈnɪðɟi"},
{"nedġi", "ˈnɛðxi"},
{"Teltsġvi", "ˈtʰɛɬt͡sxwi"},
{"uįokỏesġen", "ˌujɔˈkʰʊːɛsxɛn"},
{"hait", "ˈhaɪʔɪ"},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
{"", ""},
}
self:iterate(list, "check_output")
end
return tests