Module:fi-pronunciation/testcases

local tests = require "Module:UnitTests" local rhyme = require "Module:fi-pronunciation".generate_rhyme

local function link_fi(term) return ' " .. term .. ' ' end

local function tag_IPA(transcription) return ' ' .. transcription .. ' ' end

function tests:test_phonetic local examples = { "rhyme detection", { "kala", "ɑlɑ" }, { "lehto", "ehto" }, { "ehto", "ehto" }, { "yö", "yø" }, { "omenanamme", "ɑmːe" }, { "liu'utus", "iu.utus" }, -- iuʔutus }	local options = { display = tag_IPA } self:iterate(examples,		function (self, term, expected, respelling)			self:equals( link_fi(term) .. (respelling and " ( " .. respelling .. " )" or ""), rhyme(respelling or term, true), expected, options)		end) end

return tests