Module:anui-pron/testcases: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
local tests = require('Module:UnitTests')
local tests = require('Module:UnitTests')
local m_IPA = require('Module:anui-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 .. "|" .. text .. "]]"
end
function tests:check_output(term, expected)
return tests:equals(
linkup(term),
m_IPA.crux(term),
expected,
{ display = IPA_style }
)
end


function tests:test_example()
function tests:test_example()

Revision as of 14:51, 1 July 2021


All tests passed. (refresh)
Text Expected Actual
test_example:

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

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

function tests:test_example()
	local list = {
		{"aa", "aː"},
		{"aã", "ãː"},
		{"àa", "a̰ː"},
		{"àã", "ã̰ː"},
		{"àʼa", "a̰ʔa"},
		{"àʼã", "ã̰ʔã"},
		{"um", "m̍ː˥˦"},
		{"ùm", "m̰̍ː˧"},
		{"mʼm", "m̰̍ʔm˧"},
	}
end

return tests