All tests passed. (refresh)
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õ", "", "", "" },
{ "penatòpo", "", "penaːtohpo", "", "", "" },
{ "pakajàu", "", "pakaːjaʔu", "", "", "" },
{ "nỳnòpo", "", "nɨʔnohpo", "", "", "" },
{ "mosokoroi", "", "mosoːkoɽoi", "", "", "" },
{ "matuwituwi", "", "matuːwitʲuːwi", "", "", "" },
{ "kutàa", "", "kutaʔa", "", "", "" },
{ "kurewakoimo", "", "kuɽeːwakoimʲo", "", "", "" },
{ "kuitasere", "", "kuitʲaseːɾe", "", "", "" },
{ "óruwa", "", "oːɽuwa", "", "", "" },
{ "kòwarono", "", "koʔwaɽoːno", "", "", "" },
{ "aipajawa", "", "aipʲajaːwa", "", "", "" },
{ "tapusikiri", "", "tapuːʃikiːɾi", "", "", "" },
{ "irompỳpa", "", "iɾompɨhpa", "", "", "" },
{ "siriko", "", "ʃiɾiːkʲo", "", "", "" },
{ "wykai", "", "wɨːkai", "", "", "" },
{ "`kuru", "", "hkuɽu", "", "", "" },
{ "yrompyi", "", "ɨɽompɨi", "", "", "" },
{ "kynemanjan", "", "kɨneːmaɲjã", "", "", "" },
{ "sikàsa", "", "ʃikʲahsa", "", "", "" },
{ "sisekai", "", "ʃiʃeːkai", "", "", "" },
{ "iro", "", "iːɾo", "", "", "" },
{ "semaje", "", "semaːje", "", "", "" },
{ "tuwerikike", "", "tuweːɾikiːkʲe", "", "", "" },
{ "awumpo", "", "awumpo", "", "", "" },
{ "poinko", "", "poiŋkʲo", "", "", "" },
{ "ayran", "", "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