Module:siwa-pron/testcases: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
function tests:check_output(term, expected, noresp)
function tests:check_output(term, expected, noresp)
return tests:equals(
return tests:equals(
noresp and "[[Contionary:" .. noresp .. "#Siwa|" .. noresp .. "]] (" .. noresp .. ")" or "[[Contionary:" .. term .. "#Siwa|" .. term .. "]]",
noresp and "[[Contionary:" .. noresp .. "#Siwa|" .. noresp .. "]] (" .. term .. ")" or "[[Contionary:" .. term .. "#Siwa|" .. term .. "]]",
m_IPA.crux(term),
m_IPA.crux(term),
expected,
expected,

Revision as of 23:53, 2 January 2021


5 of 29 tests failed. (refresh)

TextExpectedActual
test_example:
Passedkigįiniˈcʰijːiniˈcʰijːini
Passedgedliˈɟetɬiˈɟetɬi
Passedpoaṡṡiˈpʰɔɑɕːiˈpʰɔɑɕːi
Failedkatsaˈkʰɑtsaˈkʰɑt͡sa
Error creating thumbnail: dảdnaˈdæːʔt̚naˈdæːʔt̚na
Error creating thumbnail: dảnakaˈdæːnɑɡaˈdæːnɑɡa
Error creating thumbnail: kęmesˈcʰæmɛsˈcʰæmɛs
Failedpilraˈpɪlraˈpʰɪlra
Error creating thumbnail: tygiˈtʰyɟiˈtʰyɟi
Error creating thumbnail: ymniˈœmnːiˈœmnːi
Failedtsġiaugaˈtsxiɑuɣaˈt͡sxiɑuɣa
Error creating thumbnail: huoibmuiˈhʊɔɪʔp̚muiˈhʊɔɪʔp̚mui
Error creating thumbnail: mammaˈmɑmːaˈmɑmːa
Error creating thumbnail: hįůdįaˈhjød͡ʑaˈhjød͡ʑa
Error creating thumbnail: tỏˈtʰʊːˈtʰʊː
Error creating thumbnail: gįosinˈɟɔsɪnˈɟɔsɪn
Error creating thumbnail: kikaˈcʰikaˈcʰika
Error creating thumbnail: tsepuˈt͡sepuˈt͡sepu
Error creating thumbnail: huhhiˈhuhːiˈhuhːi
Error creating thumbnail: tůppůˈtʰœʔpøˈtʰœʔpø
Error creating thumbnail: sauṡpỉdnaˈsaʊɕpiːʔt̚naˈsaʊɕpiːʔt̚na
Error creating thumbnail: voaknaˈvɔaʔk̚ŋaˈvɔaʔk̚ŋa
Error creating thumbnail: toḥḥamiˈtʰɔʔːɑmiˈtʰɔʔːɑmi
Error creating thumbnail: oddoˈɔtːɔˈɔtːɔ
Error creating thumbnail: niḍgiˈnɪðɟiˈnɪðɟi
Error creating thumbnail: nedġiˈnɛðxiˈnɛðxi
Error creating thumbnail: Teltsġviˈtʰɛɬt͡sxwiˈtʰɛɬt͡sxwi
Faileduįokỏesġen (uįo·kỏesġen)ˌujɔˈkʰʊːɛsxɛnˌujɔˈk⁽ʰ⁾ʊːɛsxɛn
Failedhaitˈhaɪʔɪˈhaɪt͡ɕ

local tests = require('Module:UnitTests')
local m_IPA = require('Module:siwa-pron')

local function IPA_style(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, noresp)
	return tests:equals(
		noresp and "[[Contionary:" .. noresp .. "#Siwa|" .. noresp .. "]] (" .. term .. ")" or "[[Contionary:" .. term .. "#Siwa|" .. term .. "]]",
		m_IPA.crux(term),
		expected,
		{ display = IPA_style }
	)
end

function tests:test_example()
	local list = {
		{"kigįini", "ˈ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įo·kỏesġen", "ˌujɔˈkʰʊːɛsxɛn", "uįokỏesġen"},
		{"hait", "ˈhaɪʔɪ"},
		--[[{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},]]
	}
	self:iterate(list, "check_output")
end

return tests