Module:qhv-pron/testcases: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 30: Line 30:
function tests:test_modern()
function tests:test_modern()
local list = {
local list = {
{"drakarys", "dra.ˈka.ɾys"},
{"drakarys", "draˈkaɾys"},
{"valonqar", "va.ˈloɴ.qar"},
{"valonqar", "vaˈloɴqar"},
{"Thoros", "ˈθo.ɾos"},
{"Thoros", "ˈθoɾos"},
{"arakh", "a.ˈɾax"},
{"arakh", "aˈɾax"},
{"ēngos", "ˈeːŋ.ɡos"},
{"ēngos", "ˈeːŋɡos"},
{"amīvindigon", "a.miː.ˈvin.di.ɡon"},
{"amīvindigon", "amiːˈvindiɡon"},
{"ojehiknon", "o.je.ˈhik.non"},
{"ojehiknon", "ojeˈhiknon"},
{"pōja", "ˈpoː.ja"},
{"pōja", "ˈpoːja"},
{"riña", "ˈri.ɲa"},
{"riña", "ˈriɲa"},
{"zirȳla", "zi.ˈɾyː.la"},
{"zirȳla", "ziˈɾyːla"},
{"ipradis", "i.ˈpra.dis"},
{"ipradis", "iˈpradis"},
{"rholagon", "r̥oˈlaɡon"},
{"rholagon", "ṛoˈlaɡon"},
}
}
self:iterate(list, "check_output")
self:iterate(list, "check_output")
Line 48: Line 48:
function tests:test_antique()
function tests:test_antique()
local list = {
local list = {
{"vējōñe", "veː.ˈjoː.ɲe"},
{"vējōñe", "veːˈjoːɲe"},
{"vōljes", "ˈwoː.ʎes"},
{"vōljes", "ˈwoːʎes"},
{"vumbiarzy", "ˈwum.bi͜ar.zy"},
{"vumbiarzy", "ˈwumbi͜azy"},
{"vȳs", "ˈɥyːs"},
{"vȳs", "ˈɥyːs"},
{"ȳgha", "ˈyː.ɣa"},
{"ȳgha", "ˈyːɣa"},
{"vajie", "ˈɥa.ɟi͜e"},
{"vajie", "ˈɥaɟi͜e"},
{"vūjigon", "ˈwuː.ɟi.ɡon"},
{"vūjigon", "ˈwuːɟiɡon"},
{"qrillaodikio", "qril.ˈlao̯.di.ki͜o"},
{"qrillaodikio", "qrilˈlao̯diki͜o"},
}
}
self:iterate(list, "check_output2")
self:iterate(list, "check_output2")

Revision as of 19:48, 7 February 2021


3 tests failed. (refresh)
Text Expected Actual
test_antique:
Passed vējōñe veːˈjoːɲe veːˈjoːɲe
Passed vōljes ˈwoːʎes ˈwoːʎes
Failed vumbiarzy ˈwumbi͜azy wumˈbi͜arzy
Failed vȳs ˈɥyːs ɥyːs
Passed ȳgha ˈyːɣa ˈyːɣa
Passed vajie ˈɥaɟi͜e ˈɥaɟi͜e
Passed vūjigon ˈwuːɟiɡon ˈwuːɟiɡon
Passed qrillaodikio qrilˈlao̯diki͜o qrilˈlao̯diki͜o
Text Expected Actual
test_modern:
Passed drakarys draˈkaɾys draˈkaɾys
Passed valonqar vaˈloɴqar vaˈloɴqar
Passed Thoros ˈθoɾos ˈθoɾos
Failed arakh aˈɾax ˈaɾax
Passed ēngos ˈeːŋɡos ˈeːŋɡos
Passed amīvindigon amiːˈvindiɡon amiːˈvindiɡon
Passed ojehiknon ojeˈhiknon ojeˈhiknon
Passed pōja ˈpoːja ˈpoːja
Passed riña ˈriɲa ˈriɲa
Passed zirȳla ziˈɾyːla ziˈɾyːla
Passed ipradis iˈpradis iˈpradis
Passed rholagon ṛoˈlaɡon ṛoˈlaɡon

local tests = require('Module:UnitTests')
local m_IPA = require('Module:qhv-pron')

local function IPA_style(IPA)
	return '<span style="font-size:110%;font-family:Gentium,\'DejaVu Sans\',\'Segoe UI\',sans-serif>' .. IPA .. '</span>'
end

local function linkup(text)
	return "[[Contionary:" .. text .. "#High Valyrian|" .. text .. "]]"
end

function tests:check_output(term, expected)
	return tests:equals(
		linkup(term),
		m_IPA.crux(term),
		expected,
		{ display = IPA_style }
	)
end

function tests:check_output2(term, expected)
	return tests:equals(
		linkup(term),
		m_IPA.antique_crux(term),
		expected,
		{ display = IPA_style }
	)
end

function tests:test_modern()
	local list = {
		{"drakarys", "draˈkaɾys"},
		{"valonqar", "vaˈloɴqar"},
		{"Thoros", "ˈθoɾos"},
		{"arakh", "aˈɾax"},
		{"ēngos", "ˈeːŋɡos"},
		{"amīvindigon", "amiːˈvindiɡon"},
		{"ojehiknon", "ojeˈhiknon"},
		{"pōja", "ˈpoːja"},
		{"riña", "ˈriɲa"},
		{"zirȳla", "ziˈɾyːla"},
		{"ipradis", "iˈpradis"},
		{"rholagon", "ṛoˈlaɡon"},
	}
	self:iterate(list, "check_output")
end

function tests:test_antique()
	local list = {
		{"vējōñe", "veːˈjoːɲe"},
		{"vōljes", "ˈwoːʎes"},
		{"vumbiarzy", "ˈwumbi͜azy"},
		{"vȳs", "ˈɥyːs"},
		{"ȳgha", "ˈyːɣa"},
		{"vajie", "ˈɥaɟi͜e"},
		{"vūjigon", "ˈwuːɟiɡon"},
		{"qrillaodikio", "qrilˈlao̯diki͜o"},
	}
	self:iterate(list, "check_output2")
end

return tests