Module:ábḫ-ipa/remake/testcases: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 21: Line 21:
function tests:test_example()
function tests:test_example()
local list = {
local list = {
{"zaḫáza", "θ̱ɐˈxá.θ̱ɐ"},
{"zaḫáza", "θ̱ɐˈxä˦.θ̱ɐ"},
{"áken", "ˈä˦.kɛn̪"},
{"áken", "ˈä˦.kɛn̪"},
--[[{"", ""},
--[[{"", ""},

Latest revision as of 14:26, 10 April 2021

2 tests failed. (refresh)

Text Expected Actual
test_example:
Failed zaḫáza θ̱ɐˈxä˦.θ̱ɐ θä-xä˦-θä
Failed áken ˈä˦.kɛn̪ ä˦-ken

local tests = require('Module:UnitTests')
local m_IPA = require('Module:ábḫ-ipa/remake')

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 .. "#Ábḫanni|" .. text .. "]]"
end

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

function tests:test_example()
	local list = {
		{"zaḫáza", "θ̱ɐˈxä˦.θ̱ɐ"},
		{"áken", "ˈä˦.kɛn̪"},
		--[[{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},
		{"", ""},]]
	}
	self:iterate(list, "check_output")
end

return tests