Module:qlu-pron/testcases

From Linguifex
< Module:qlu-pron
Revision as of 17:10, 22 January 2025 by Sware (talk | contribs) (Created page with "local tests = require('Module:UnitTests') local m_IPA = require('Module:qlu-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 "" .. text .. "" end function tests:check_output(term, expected, noresp) return tests:equals( noresp and linkup(noresp) .. "<br>(" .. term .. ")" or linkup(term...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

11 of 11 tests failed. (refresh)
TextExpectedActual
test_example:
Failedliuvaleicu
(liuvaleicu)
/ˌliw.βɐˈli.ku/ [ˌlʏw.βɐˈli.xu]table
Failedcreggu
(creggu)
/ˈkreŋ.ɡu/ [ˈkreŋ˗.ɡ˗u]table
Failedcregghi
(creggi)
/ˈkreŋ.ɡi/ [ˈkreŋ˖.ɡ̟i]table
Failedaggio
(aggio)
/ˈad.d͡ʒo/ [ˈad.d͡ʒo]table
Failedagghiu
(aggiu)
/ˈaŋ.ɡ̟ju/ [ˈaŋ˖.ɡ̟ju]table
Failedpittsa
(pizza)
/ˈpit.t͡sɐ/ [ˈpit.t͡sɐ]table
Failedaddzurru
(azzurru)
/ɐdˈd͡zur.ru/ [ɐdˈd͡zur.ru]table
Failedlugheze
(lughese)
/luˈɡe.ze/ [luˈɡ̟e.ze]table
Failedpharmacïa
(pharmacia)
/fɐr.mɐˈtʃi.ɐ/ [fɐr.mɐˈtʃi.ɐ]table
Failedaglio
(aglio)
/ˈaʎ.ʎo/ [ˈaʎ.ʎo]table
Failedaglïare
(agliare)
/ɐʎˈʎja.re/ [ɐʎˈʎja.re]table

local tests = require('Module:UnitTests')
local m_IPA = require('Module:qlu-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 .. "#Luthic|" .. text .. "]]"
end

function tests:check_output(term, expected, noresp)
	return tests:equals(
		noresp and linkup(noresp) .. "<br>(" .. term .. ")" or linkup(term),
		m_IPA.crux(term, "test"),
		expected,
		{ display = IPA_style, show_difference = true }
	)
end

function tests:test_example()
	local list = {
		{"liuvaleicu", "/ˌliw.βɐˈli.ku/ [ˌlʏw.βɐˈli.xu]", "liuvaleicu"},
		{"creggu", "/ˈkreŋ.ɡu/ [ˈkreŋ˗.ɡ˗u]", "creggu"},
		{"creggi", "/ˈkreŋ.ɡi/ [ˈkreŋ˖.ɡ̟i]", "cregghi"},
		{"aggio", "/ˈad.d͡ʒo/ [ˈad.d͡ʒo]", "aggio"},
		{"aggiu", "/ˈaŋ.ɡ̟ju/ [ˈaŋ˖.ɡ̟ju]", "agghiu"},
		{"pizza", "/ˈpit.t͡sɐ/ [ˈpit.t͡sɐ]", "pittsa"},
		{"azzurru", "/ɐdˈd͡zur.ru/ [ɐdˈd͡zur.ru]", "addzurru"},
		{"lughese", "/luˈɡe.ze/ [luˈɡ̟e.ze]", "lugheze"},
		{"pharmacia", "/fɐr.mɐˈtʃi.ɐ/ [fɐr.mɐˈtʃi.ɐ]", "pharmacïa"},
		{"aglio", "/ˈaʎ.ʎo/ [ˈaʎ.ʎo]", "aglio"},
		{"agliare", "/ɐʎˈʎja.re/ [ɐʎˈʎja.re]", "aglïare"},
		--[[{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},]]
	}
	self:iterate(list, "check_output")
end

return tests