Module:User:AmazingJus/sce/testcases

Hello, you have come here looking for the meaning of the word Module:User:AmazingJus/sce/testcases. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:AmazingJus/sce/testcases, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:AmazingJus/sce/testcases in singular and plural. Everything you need to know about the word Module:User:AmazingJus/sce/testcases you have here. The definition of the word Module:User:AmazingJus/sce/testcases will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:AmazingJus/sce/testcases, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

3 of 10 tests failed. (refresh)

TextExpectedActual
test_phonemic_IPA:
Passedbaer/pɑˈɚ//pɑˈɚ/
Passedtiigha/tʰɯˈqɑ//tʰɯˈqɑ/
Passedniere/njəˈrə//njəˈrə/
Passedenzhegve/ənt͡ʂəˈʁə//ənt͡ʂəˈʁə/
Passedxiaojierun (xiaojieruŋ)/ɕjɑwt͡ɕjəˈruŋ//ɕjɑwt͡ɕjəˈruŋ/
Passedershi ('ershi)/ˈɚʂi//ˈɚʂi/
Passedruhher ('ruhher)/ˈʐuhɚ//ˈʐuhɚ/
TextExpectedActual
test_phonetic_IPA:
Failedershi ('ershi)
Failedkorolon (koroloŋ)
Failedhotou

local tests = require("Module:UnitTests")
local m_IPA = require("Module:User:AmazingJus/sce")
local gsub = mw.ustring.gsub

local sce = require("Module:languages").getByCode("sce")
local function link(text)
	return require("Module:links").full_link { term = text, lang = sce }
end

local function respell(term)
    local original_term = term
    term = gsub(term, "'", ""):gsub("ŋ", "n")
    return term, original_term ~= term and term or nil
end

function tests:test_phonemic_IPA()
	local testcases = {
		{ "baer", "pɑˈɚ" },
		{ "tiigha", "tʰɯˈqɑ" },
		{ "niere", "njəˈrə" },
		{ "enzhegve", "ənt͡ʂəˈʁə" },
		{ "xiaojieruŋ", "ɕjɑwt͡ɕjəˈruŋ" },
		{ "'ershi", "ˈɚʂi", "zh" },
		{ "'ruhher", "ˈʐuhɚ", "zh" }
	}

	local options = {
		display = function(IPA)
			return '<span class="IPA">/' .. IPA .. '/</span>'
		end
	}

	self:iterate(testcases, function(self, term, IPA, etyl)
		local respelt, is_respelt = respell(term)

		if is_respelt then
			self:equals(link(respelt) .. " (<code>" .. term .. "</code>)", m_IPA.IPA_m(term, etyl), IPA, options)
		else
			self:equals(link(term), m_IPA.IPA_m(term, etyl), IPA, options)
		end
	end)
end

function tests:test_phonetic_IPA()
	local testcases = {
		{ "'ershi", "ˈɚʂɨ", "zh" },
		{ "koroloŋ", "kʰoroˈlõŋ" },
		{ "hotou", "xʷoˈtʰəu̯ ~ xʷoˈtʰɤu̯" }
	}

	local options = {
		display = function(IPA)
			return '<span class="IPA"></span>'
		end
	}

	self:iterate(testcases, function(self, term, IPA, etyl)
		local respelt, is_respelt = respell(term)

		if is_respelt then
			self:equals(link(respelt) .. " (<code>" .. term .. "</code>)", m_IPA.IPA_t(term, etyl), IPA, options)
		else
			self:equals(link(term), m_IPA.IPA_t(term, etyl), IPA, options)
		end
	end)
end

return tests