Module:ábḫ-ipa/remake/testcases

From Linguifex
< Module:ábḫ-ipa‎ | remake
Revision as of 13:01, 10 April 2021 by Sware (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

1 test failed. (refresh)

Text Expected Actual
test_example:
Script error during testing: Module:ábḫ-ipa/remake/testcases:15: attempt to call field 'crux' (a nil value)
stack traceback:
	Module:ábḫ-ipa/remake/testcases:15: in function 'func'
	Module:UnitTests:247: in function 'iterate'
	Module:ábḫ-ipa/remake/testcases:36: in function <Module:ábḫ-ipa/remake/testcases:21>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:299: in function <Module:UnitTests:261>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	(tail call): ?
	[C]: in function 'xpcall'
	...cribunto/includes/engines/LuaStandalone/MWServer.lua:99: in function 'handleCall'
	...cribunto/includes/engines/LuaStandalone/MWServer.lua:313: in function 'dispatch'
	...cribunto/includes/engines/LuaStandalone/MWServer.lua:52: in function 'execute'
	...Scribunto/includes/engines/LuaStandalone/mw_main.lua:7: in main chunk
	[C]: ?

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.crux(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