Jump to content

Module:ii-pron/testcases

From Wiktionary, the free dictionary

1 of 0 tests failed. (refresh)

TextExpectedActualDiffers at
test_ipa:
Script error during testing: bad argument #1 to 'find' (string expected, got nil)
stack traceback:
	[C]: ?
	[C]: in function 'v'
	mw.ustring.lua:84: in function 'find'
	Module:ii-pron:40: in function 'ipa'
	Module:ii-pron/testcases:5: in function 'check_ipa'
	Module:ii-pron/testcases:9: in function <Module:ii-pron/testcases:8>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:370: in function <Module:UnitTests:329>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:892: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

local tests = require('Module:UnitTests')
local m = require('Module:ii-pron')

function tests:check_ipa(text, ipa)
	self:equals(text, m.ipa(text), ipa)
end

function tests:test_ipa()
	self:check_ipa("ꆈꌠ", "nɔ˧˧ su˧˧")
	self:check_ipa("ꀀꀕ", "i˥˥ i˥˥")
	self:check_ipa("ꆈꉙ", "nɔ˧˧ ho˨˩")
	self:check_ipa("ꃬꇁꁍꎐꈢ", "va˧˧ la˧˧ pʰu˨˩ dʐʐ̩˧˧ ɡo˥˥")
	self:check_ipa("ꒉ", "ʑz̩˧˧")
	self:check_ipa("ꍏꇩ", "tʂo˧˧ kɔ˨˩")
end

return tests