Module:hnm-pron/testcases

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This is the unit-testing module for Module:hnm-pron.

All tests passed. (refresh)

TextExpectedActualDiffers at
test_ipa:
Passedghua3/ɡua³¹//ɡua³¹/
Passedddin6 di6/ɗien⁵³⁻⁴² ti⁵³//ɗien⁵³⁻⁴² ti⁵³/
Passedgin4 hhua1 dua1/kien¹¹ ɦua³³ tua³³//kien¹¹ ɦua³³ tua³³/
Passedhhue1 li2 geh7/ɦue³³ li²² keʔ⁵³//ɦue³³ li²² keʔ⁵³/

local p = require('Module:UnitTests')
local m = require('Module:hnm-pron')

function p:ipa(text, expected)
	self:equals(text, '<span class="IPA">' .. m.ipa(text) .. '</span>', '<span class="IPA">' .. expected .. '</span>')
end

function p:test_ipa()
	self:ipa('ghua3', '/ɡua³¹/')
	self:ipa('ddin6 di6', '/ɗien⁵³⁻⁴² ti⁵³/')
	self:ipa('gin4 hhua1 dua1', '/kien¹¹ ɦua³³ tua³³/')
	self:ipa('hhue1 li2 geh7', '/ɦue³³ li²² keʔ⁵³/')
end

return p