Jump to content

Module:luh-pron/testcases

From Wiktionary, the free dictionary

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

6 of 14 tests failed. (refresh)

TextExpectedActualDiffers at
test_ipa:
Failedxieng1 ku1/ɕieŋ³⁵⁻³³ kʰu³⁵//sieŋ³⁵⁻³³ kʰu³⁵/20
Passedsoi1 tao5/sɔi³⁵⁻³³ tʰau²²//sɔi³⁵⁻³³ tʰau²²/
Passedgeu1 so2/kɛu³⁵⁻³³ sɔ³¹//kɛu³⁵⁻³³ sɔ³¹/
Passedsu1 bhang6/su³⁵⁻³³ baŋ³³//su³⁵⁻³³ baŋ³³/
Failedxieng1 xi3/ɕieŋ³⁵⁻³³ ɕi²¹//sieŋ³⁵⁻³³ si²¹/20
Passedgam1 lu7/kam³⁵⁻³³ lu⁵⁵//kam³⁵⁻³³ lu⁵⁵/
Failedsua1 dib4/sua³⁵⁻³³ tip⁵//sua³⁵⁻³³ tip̚⁵/32
Failedse1 ieg8/sɛ³⁵⁻³³ iek²//sɛ³⁵⁻³³ iek̚²/31
Failedbi1 qio6 gi5/pi³⁵⁻³³ t͡ɕʰiɔ³³ ki²²//pi³⁵⁻³³ t͡sʰiɔ³³ ki²²/30
Failedbi2# ka1 ue6 qiu2/pi³¹ kʰa³⁵⁻³³ uɛ³³ t͡ɕʰiu³¹//pi³¹ kʰa³⁵⁻³³ uɛ³³ t͡sʰiu³¹/41
Passedbi3 liang5 bi3 zua5/pi²¹⁻⁵⁵ liaŋ²² pi²¹⁻⁵⁵ t͡sua²²//pi²¹⁻⁵⁵ liaŋ²² pi²¹⁻⁵⁵ t͡sua²²/
Passedbi3 liang5/pi²¹⁻⁵⁵ liaŋ²²//pi²¹⁻⁵⁵ liaŋ²²/
Passedpi1# gao1 gao1/pʰi³⁵ kau³⁵⁻³³ kau³⁵//pʰi³⁵ kau³⁵⁻³³ kau³⁵/
Passedpi1 kang1 mo5/pʰi³⁵⁻³³ kʰaŋ³⁵⁻³³ mɔ²²//pʰi³⁵⁻³³ kʰaŋ³⁵⁻³³ mɔ²²/

local p = require('Module:UnitTests')
local m = require('Module:luh-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('xieng1 ku1', 'ɕieŋ³⁵⁻³³ kʰu³⁵')
	self:ipa('soi1 tao5', 'sɔi³⁵⁻³³ tʰau²²')
	self:ipa('geu1 so2', 'kɛu³⁵⁻³³ sɔ³¹')
	self:ipa('su1 bhang6', 'su³⁵⁻³³ baŋ³³')
	self:ipa('xieng1 xi3', 'ɕieŋ³⁵⁻³³ ɕi²¹')
	self:ipa('gam1 lu7', 'kam³⁵⁻³³ lu⁵⁵')
	self:ipa('sua1 dib4', 'sua³⁵⁻³³ tip⁵')
	self:ipa('se1 ieg8', 'sɛ³⁵⁻³³ iek²')
	self:ipa('bi1 qio6 gi5', 'pi³⁵⁻³³ t͡ɕʰiɔ³³ ki²²')
	self:ipa('bi2# ka1 ue6 qiu2', 'pi³¹ kʰa³⁵⁻³³ uɛ³³ t͡ɕʰiu³¹')
	self:ipa('bi3 liang5 bi3 zua5', 'pi²¹⁻⁵⁵ liaŋ²² pi²¹⁻⁵⁵ t͡sua²²')
	self:ipa('bi3 liang5', 'pi²¹⁻⁵⁵ liaŋ²²')
	self:ipa('pi1# gao1 gao1', 'pʰi³⁵ kau³⁵⁻³³ kau³⁵')
	self:ipa('pi1 kang1 mo5', 'pʰi³⁵⁻³³ kʰaŋ³⁵⁻³³ mɔ²²')
end

return p