Module:qhv-pron/testcases: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 41: Line 41:
{"zirȳla", "zi.ˈɾyː.la"},
{"zirȳla", "zi.ˈɾyː.la"},
{"ipradis", "i.ˈpra.dis"},
{"ipradis", "i.ˈpra.dis"},
{"rholagon", "r̥oˈlaɡon"},
}
}
self:iterate(list, "check_output")
self:iterate(list, "check_output")

Revision as of 19:46, 7 February 2021


20 tests failed. (refresh)
Text Expected Actual
test_antique:
Failed vējōñe veː.ˈjoː.ɲe veːˈjoːɲe
Failed vōljes ˈwoː.ʎes ˈwoːʎes
Failed vumbiarzy ˈwum.bi͜ar.zy wumˈbi͜arzy
Failed vȳs ˈɥyːs ɥyːs
Failed ȳgha ˈyː.ɣa ˈyːɣa
Failed vajie ˈɥa.ɟi͜e ˈɥaɟi͜e
Failed vūjigon ˈwuː.ɟi.ɡon ˈwuːɟiɡon
Failed qrillaodikio qril.ˈlao̯.di.ki͜o qrilˈlao̯diki͜o
Text Expected Actual
test_modern:
Failed drakarys dra.ˈka.ɾys draˈkaɾys
Failed valonqar va.ˈloɴ.qar vaˈloɴqar
Failed Thoros ˈθo.ɾos ˈθoɾos
Failed arakh a.ˈɾax ˈaɾax
Failed ēngos ˈeːŋ.ɡos ˈeːŋɡos
Failed amīvindigon a.miː.ˈvin.di.ɡon amiːˈvindiɡon
Failed ojehiknon o.je.ˈhik.non ojeˈhiknon
Failed pōja ˈpoː.ja ˈpoːja
Failed riña ˈri.ɲa ˈriɲa
Failed zirȳla zi.ˈɾyː.la ziˈɾyːla
Failed ipradis i.ˈpra.dis iˈpradis
Failed rholagon r̥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", "a.miː.ˈvin.di.ɡon"},
		{"ojehiknon", "o.je.ˈhik.non"},
		{"pōja", "ˈpoː.ja"},
		{"riña", "ˈri.ɲa"},
		{"zirȳla", "zi.ˈɾyː.la"},
		{"ipradis", "i.ˈpra.dis"},
		{"rholagon", "r̥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", "ˈwum.bi͜ar.zy"},
		{"vȳs", "ˈɥyːs"},
		{"ȳgha", "ˈyː.ɣa"},
		{"vajie", "ˈɥa.ɟi͜e"},
		{"vūjigon", "ˈwuː.ɟi.ɡon"},
		{"qrillaodikio", "qril.ˈlao̯.di.ki͜o"},
	}
	self:iterate(list, "check_output2")
end

return tests