Jump to content

Module:car-IPA/testcases

From Wiktionary, the free dictionary

All tests passed. (refresh)

TextExpectedActual
test_all:
Miscellaneous
Passedykyryjatononɨkɨːɽɨjaːtonõɨkɨːɽɨjaːtonõ
Passedpenatòpopenaːtohpopenaːtohpo
Passedpakajàupakaːjaʔupakaːjaʔu
Passednỳnòponɨʔnohponɨʔnohpo
Passedmosokoroimosoːkoɽoimosoːkoɽoi
Passedmatuwituwimatuːwitʲuːwimatuːwitʲuːwi
Passedkutàakutaʔakutaʔa
Passedkurewakoimokuɽeːwakoimʲokuɽeːwakoimʲo
Passedkuitaserekuitʲaseːɾekuitʲaseːɾe
Passedóruwaoːɽuwaoːɽuwa
Passedkòwaronokoʔwaɽoːnokoʔwaɽoːno
Passedaipajawaaipʲajaːwaaipʲajaːwa
Passedtapusikiritapuːʃikiːɾitapuːʃikiːɾi
Passedirompỳpaiɾompɨhpaiɾompɨhpa
Passedsirikoʃiɾiːkʲoʃiɾiːkʲo
Passedwykaiwɨːkaiwɨːkai
Passed`kuruhkuɽuhkuɽu
Passedyrompyiɨɽompɨiɨɽompɨi
Passedkynemanjankɨneːmaɲjãkɨneːmaɲjã
Passedsikàsaʃikʲahsaʃikʲahsa
Passedsisekaiʃiʃeːkaiʃiʃeːkai
Passediroiːɾoiːɾo
Passedsemajesemaːjesemaːje
Passedtuwerikiketuweːɾikiːkʲetuweːɾikiːkʲe
Passedawumpoawumpoawumpo
Passedpoinkopoiŋkʲopoiŋkʲo
Passedayranaɨɽãaɨɽã
Miscellaneous
Passedykyryjatonon[kɨːɺ̢ɨðaːtonõ][kɨːɺ̢ɨðaːtonõ]
Passedpenatòpo[penaːtoho][penaːtoho]
Passedpakajàu[pakaːðaʔu][pakaːðaʔu]
Passednỳnòpo[nɨʔnoho][nɨʔnoho]
Passedmosokoroi[mosoːkoɺ̢oj][mosoːkoɺ̢oj]
Passedmatuwituwi[matuwwitʃuwwi][matuwwitʃuwwi]
Passedkutàa[kutaʔa][kutaʔa]
Passedkurewakoimo[kuɺ̢eːβakommʲo][kuɺ̢eːβakommʲo]
Passedkuitasere[kuttʃaseːɾe][kuttʃaseːɾe]
Passedóruwa[oːɺ̢uwa][oːɺ̢uwa]
Passedkòwarono[koʔβaɺ̢oːno][koʔβaɺ̢oːno]
Passedaipajawa[appʲaðaːβa][appʲaðaːβa]
Passedtapusikiri[tapuhʃikiːɾi][tapuhʃikiːɾi]
Passedirompỳpa[jompɨha][jompɨha]
Passedsiriko[ʃiɾihʃo][ʃiɾihʃo]
Passedwykai[βɨkkaj][βɨkkaj]
Passed`kuru[hkuɺ̢u][hkuɺ̢u]
Passedyrompyi[ɺ̢ɰompi][ɺ̢ɰompi]
Passedkynemanjan[kɨneːmaɲɲã][kɨneːmaɲɲã]
Passedsikàsa[ʃiʃahsa][ʃiʃahsa]
Passedsisekai[ʃiʃeːkaj][ʃiʃeːkaj]
Passediro[ijjo][ijjo]
Passedsemaje[semaːe][semaːe]
Passedtuwerikike[tuweːɾikihʃe][tuweːɾikihʃe]
Passedawumpo[aumpwo][aumpwo]
Passedpoinko[pojnʃo][pojnʃo]
Passedayran[aɰɺ̢ɰã][aɰɺ̢ɰã]
Miscellaneous
Passedykyryjatonon[kɨːɺ̢ɨjaːtonõ][kɨːɺ̢ɨjaːtonõ]
Passedpenatòpo[penaːtohpo][penaːtohpo]
Passedpakajàu[pakaːjaʔu][pakaːjaʔu]
Passednỳnòpo[nɨʔnohpo][nɨʔnohpo]
Passedmosokoroi[mosoːkoɺ̢oj][mosoːkoɺ̢oj]
Passedmatuwituwi[matuːwitʲuːwi][matuːwitʲuːwi]
Passedkutàa[kutaʔa][kutaʔa]
Passedkurewakoimo[kuɺ̢eːʋakojmʲo][kuɺ̢eːʋakojmʲo]
Passedkuitasere[kujtʲaseːɾe][kujtʲaseːɾe]
Passedóruwa[oːɺ̢uwa][oːɺ̢uwa]
Passedkòwarono[koʔʋaɺ̢oːno][koʔʋaɺ̢oːno]
Passedaipajawa[ajpʲajaːʋa][ajpʲajaːʋa]
Passedtapusikiri[tapuːʃikiːɾi][tapuːʃikiːɾi]
Passedirompỳpa[idʝombɨhpa][idʝombɨhpa]
Passedsiriko[ʃiɾiːco][ʃiɾiːco]
Passedwykai[ʋɨːkaj][ʋɨːkaj]
Passed`kuru[hkuɺ̢u][hkuɺ̢u]
Passedyrompyi[ɺ̢ombɨj][ɺ̢ombɨj]
Passedkynemanjan[kɨneːmajjã][kɨneːmajjã]
Passedsikàsa[ʃicahsa][ʃicahsa]
Passedsisekai[ʃiʃeːkaj][ʃiʃeːkaj]
Passediro[iːdʝo][iːdʝo]
Passedsemaje[semaːe][semaːe]
Passedtuwerikike[tuweːɾikiːce][tuweːɾikiːce]
Passedawumpo[aumbo][aumbo]
Passedpoinko[pojɲɟo][pojɲɟo]
Passedayran[aɰɺ̢ã][aɰɺ̢ã]
Miscellaneous
Passedykyryjatonon[ɡɨːɺ̢ɨjaʔtonõ][ɡɨːɺ̢ɨjaʔtonõ]
Passedpenatòpo[penaʔtohpo][penaʔtohpo]
Passedpakajàu[paɡaːjaʔu][paɡaːjaʔu]
Passednỳnòpo[nɨʔnohpo][nɨʔnohpo]
Passedmosokoroi[mosoʔkoɺ̢oj][mosoʔkoɺ̢oj]
Passedmatuwituwi[maduːwiɟuːwi][maduːwiɟuːwi]
Passedkutàa[kudaʔa][kudaʔa]
Passedkurewakoimo[kuɺ̢eːwaɡojmʲo][kuɺ̢eːwaɡojmʲo]
Passedkuitasere[kujhcaseːɾe][kujhcaseːɾe]
Passedóruwa[oːɺ̢uwa][oːɺ̢uwa]
Passedkòwarono[koʔwaɺ̢oːno][koʔwaɺ̢oːno]
Passedaipajawa[ajhpʲajaːwa][ajhpʲajaːwa]
Passedtapusikiri[tabuːʃiɡiːɾi][tabuːʃiɡiːɾi]
Passedirompỳpa[iɾom(bɨh)pa][iɾom(bɨh)pa]
Passedsiriko[ʃiɾiʔco][ʃiɾiʔco]
Passedwykai[wɨʔkaj][wɨʔkaj]
Passed`kuru[hkuɺ̢u][hkuɺ̢u]
Passedyrompyi[ɺ̢ombɨj][ɺ̢ombɨj]
Passedkynemanjan[kɨneːmajjã][kɨneːmajjã]
Passedsikàsa[ʃcahsa][ʃcahsa]
Passedsisekai[ʃːeʔkaj][ʃːeʔkaj]
Passediro[iːɾo][iːɾo]
Passedsemaje[semaːe][semaːe]
Passedtuwerikike[tuweːɾiɡiʔce][tuweːɾiɡiʔce]
Passedawumpo[aumbo][aumbo]
Passedpoinko[pojɲɟo][pojɲɟo]
Passedayran[aɰɺ̢ã][aɰɺ̢ã]

local tests = require("Module:UnitTests")
local to_IPA = require("Module:car-IPA").to_IPA
local to_base_IPA = require("Module:car-IPA").to_base_IPA
local to_Venezuelan_IPA = require("Module:car-IPA").to_Venezuelan_IPA
local to_West_Surinamese_IPA = require("Module:car-IPA").to_West_Surinamese_IPA
local to_East_Surinamese_IPA = require("Module:car-IPA").to_East_Surinamese_IPA

local lang = require("Module:languages").getByCode("car")
local Latin = require("Module:scripts").getByCode("Latn")

local function link(term)
	return require("Module:links").full_link{ term = term, lang = lang, sc = Latin }
end

local function tag_IPA(IPA)
	return '<span class="IPA">' .. IPA .. '</span>'
end

function tests:check_output_default(term, expected)
	tests:equals(
		link(term),
		to_IPA(term),
		expected,
		{ display = tag_IPA }
	)
end

function tests:check_output_base(term, unneeded1, expected)
	tests:equals(
		link(term),
		to_base_IPA(term),
		expected,
		{ display = tag_IPA }
	)
end

function tests:check_output_Venezuelan(term, unneeded1, unneeded2, expected)
	tests:equals(
		link(term),
		to_Venezuelan_IPA(to_base_IPA(term)),
		expected,
		{ display = tag_IPA }
	)
end

function tests:check_output_West_Surinamese(term, unneeded1, unneeded2, unneeded3, expected)
	tests:equals(
		link(term),
		to_West_Surinamese_IPA(to_base_IPA(term)),
		expected,
		{ display = tag_IPA }
	)
end

function tests:check_output_East_Surinamese(term, unneeded1, unneeded2, unneeded3, unneeded4, expected)
	tests:equals(
		link(term),
		to_East_Surinamese_IPA(to_base_IPA(term)),
		expected,
		{ display = tag_IPA }
	)
end

function tests:test_all()
	local list = {
        "Miscellaneous",
		{ "ykyryjatonon", "[kɨːɺ̢ɨjaːtonõ]", "ɨkɨːɽɨjaːtonõ", "[kɨːɺ̢ɨðaːtonõ]", "[kɨːɺ̢ɨjaːtonõ]",  "[ɡɨːɺ̢ɨjaʔtonõ]" },
		{ "penatòpo", "[penaːtohpo]", "penaːtohpo", "[penaːtoho]", "[penaːtohpo]", "[penaʔtohpo]" },
		{ "pakajàu", "[pakaːjaʔu]", "pakaːjaʔu", "[pakaːðaʔu]", "[pakaːjaʔu]", "[paɡaːjaʔu]" },
		{ "nỳnòpo", "[nɨʔnohpo]", "nɨʔnohpo", "[nɨʔnoho]", "[nɨʔnohpo]", "[nɨʔnohpo]" },
		{ "mosokoroi", "[mosoːkoɺ̢oj]", "mosoːkoɽoi", "[mosoːkoɺ̢oj]", "[mosoːkoɺ̢oj]", "[mosoʔkoɺ̢oj]" },
		{ "matuwituwi", "[matuːwitʲuːwi]", "matuːwitʲuːwi", "[matuwwitʃuwwi]", "[matuːwitʲuːwi]", "[maduːwiɟuːwi]" },
		{ "kutàa", "[kutaʔa]", "kutaʔa", "[kutaʔa]", "[kutaʔa]", "[kudaʔa]" },
		{ "kurewakoimo", "[kuɺ̢eːwakojmʲo]", "kuɽeːwakoimʲo", "[kuɺ̢eːβakommʲo]", "[kuɺ̢eːʋakojmʲo]", "[kuɺ̢eːwaɡojmʲo]" },
		{ "kuitasere", "[kujtʲaseːɾe]", "kuitʲaseːɾe", "[kuttʃaseːɾe]", "[kujtʲaseːɾe]", "[kujhcaseːɾe]" },
		{ "óruwa", "[oːɺ̢uwa]", "oːɽuwa", "[oːɺ̢uwa]", "[oːɺ̢uwa]", "[oːɺ̢uwa]" },
		{ "kòwarono", "[koʔwaɺ̢oːno]", "koʔwaɽoːno", "[koʔβaɺ̢oːno]", "[koʔʋaɺ̢oːno]", "[koʔwaɺ̢oːno]" },
		{ "aipajawa", "[ajpʲajaːwa]", "aipʲajaːwa", "[appʲaðaːβa]", "[ajpʲajaːʋa]", "[ajhpʲajaːwa]" },
		{ "tapusikiri", "[tapuːʃikiːɾi]", "tapuːʃikiːɾi", "[tapuhʃikiːɾi]", "[tapuːʃikiːɾi]", "[tabuːʃiɡiːɾi]" },
		{ "irompỳpa", "[iɾompɨhpa]", "iɾompɨhpa", "[jompɨha]", "[idʝombɨhpa]", "[iɾom(bɨh)pa]" },
		{ "siriko", "[ʃiɾiːkʲo]", "ʃiɾiːkʲo", "[ʃiɾihʃo]", "[ʃiɾiːco]", "[ʃiɾiʔco]" },
		{ "wykai", "[wɨːkaj]", "wɨːkai", "[βɨkkaj]", "[ʋɨːkaj]", "[wɨʔkaj]" },
		{ "`kuru", "[hkuɺ̢u]", "hkuɽu", "[hkuɺ̢u]", "[hkuɺ̢u]", "[hkuɺ̢u]" },
		{ "yrompyi", "[ɺ̢ompɨj]", "ɨɽompɨi", "[ɺ̢ɰompi]", "[ɺ̢ombɨj]", "[ɺ̢ombɨj]" },
		{ "kynemanjan", "[kɨneːmaɲjã]", "kɨneːmaɲjã", "[kɨneːmaɲɲã]", "[kɨneːmajjã]", "[kɨneːmajjã]" },
		{ "sikàsa", "[ʃikʲahsa]", "ʃikʲahsa", "[ʃiʃahsa]", "[ʃicahsa]", "[ʃcahsa]" },
		{ "sisekai", "[ʃiʃeːkaj]", "ʃiʃeːkai", "[ʃiʃeːkaj]", "[ʃiʃeːkaj]", "[ʃːeʔkaj]" },
		{ "iro", "[iːɾo]", "iːɾo", "[ijjo]", "[iːdʝo]", "[iːɾo]" },
		{ "semaje", "[semaːe]", "semaːje", "[semaːe]", "[semaːe]", "[semaːe]" },
		{ "tuwerikike", "[tuweːɾikiːkʲe]", "tuweːɾikiːkʲe", "[tuweːɾikihʃe]", "[tuweːɾikiːce]", "[tuweːɾiɡiʔce]" },
		{ "awumpo", "[aumpo]", "awumpo", "[aumpwo]", "[aumbo]", "[aumbo]" },
		{ "poinko", "[poiŋkʲo]", "poiŋkʲo", "[pojnʃo]", "[pojɲɟo]", "[pojɲɟo]" },
		{ "ayran", "[aɰɺ̢ã]", "aɨɽã", "[aɰɺ̢ɰã]", "[aɰɺ̢ã]", "[aɰɺ̢ã]" },
	}
--[[
	Additions take this form –
		{ "word", "IPA" },
		{ "", "" },
	Make sure to include the comma, or the module will return an error.
]]
	
	self:iterate(list, "check_output_base")
	self:iterate(list, "check_output_Venezuelan")
	self:iterate(list, "check_output_West_Surinamese")
	self:iterate(list, "check_output_East_Surinamese")
end

return tests