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

From Linguifex
Jump to navigation Jump to search
(Created page with "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:Gen...")
 
No edit summary
Line 13: Line 13:
return tests:equals(
return tests:equals(
linkup(term),
linkup(term),
m_IPA.crux(term),
m_IPA.show(term),
expected,
expected,
{ display = IPA_style }
{ display = IPA_style }

Revision as of 13:02, 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