Module:si-IPA/testcases

local tests = require("Module:UnitTests") local m_IPA = require("Module:si-IPA")

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

function tests:check_output(term, expected, comment) self:equals(		m_IPA.link(term),		tag_IPA(m_IPA.to_IPA(term)[1]),		tag_IPA(expected),		{ comment = comment }	) end

function tests:test_all examples = { { "කරනවා", "kərənəwa"}, { "ශ්‍රී ලංකා", "ʃriː ləŋkaː"}, { "සිංහල", "siŋhələ"}, { "සංස්කෘත", "səŋskrutə"}, } --	Copy the following to add more examples:		{ "", "" }, tests:iterate(examples, "check_output") end

return tests