Module:User:Suzukaze-c/zh-usex/testcases

local tests = require('Module:UnitTests') local m_zh_usex = require('Module:User:Suzukaze-c/zh-usex')

tests.comments = 1

function tests:check_FOO(d) self:equals_deep(d.pre, 0, d.post, { ['comment'] = (d.lect and d.lect .. ' ' or '') .. (d.pagename and d.pagename .. ' ' or '') .. d.com }) end

function tests:test_all self:check_FOO({		lect = false,		pre = '一，二. 三（四五）六七八九十',		post = {			'一，二. 三（四五）六七八九十',			false,			'vē, vē. vē (vēvē) vēvēvēvēvē',		},		com = 'tr test: with punctuation',	})

self:check_FOO({		lect = 'm',		pre = '哪些 多面體 由 十個 面 組成？',		post = {			'哪些多面體由十個面組成？',			'哪些多面体由十个面组成？',			'vēvē vēvēvē vē vēvē vē vēvē?',		},		com = 'tr test: pinyin',	})

self:check_FOO({		lect = 'c',		pre = '佢等{dei6} 聽{ting1}日 冇 嘢 做. part-time{paat1 taai1}',		post = {			'佢等聽日冇嘢做. part-time',			'佢等听日冇嘢做. part-time',			've1 dei6 ting1 ve1 ve1 ve1 ve1. paat1 taai1',		},		com = 'tr test: jyutping',	})

self:check_FOO({		lect = 'mn',		pre = '^林 教授 先 去 點菜，in 細漢kiáⁿ teh 讀 國校仔 2 年á niā-niā，iah tòe 去 看. ',		post = {			'林教授先去點菜，in細漢kiáⁿ teh讀國校仔2年á niā-niā，iah tòe去看. ',			'林教授先去点菜，in细汉kiáⁿ teh读国校仔2年á niā-niā，iah tòe去看. ',			'Ve ve-ve ve ve ve-ve, ve ve-ve-kiáⁿ teh ve ve-ve-ve 2 á niā-niā, iah tòe ve ve.',		},		com = 'tr test: peh-oe-ji',	})

self:check_FOO({		lect = 'mn',		pre = '嘛{ma} 會{e} 共{ka} 火{hoe} 翕{hip} 化{hoa}--去{khi}，所{soo}以{i} 後{au}--來{lai} 共{kai} 號{ho} 做{cho} 窒{chek}素{so}',		post = {			'嘛會共火翕化去，所以後來共號做窒素',			'嘛会共火翕化去，所以后来共号做窒素',			'ma e ka hoe hip hoa--khi, soo-i au--lai kai ho cho chek-so',		},		com = 'tr test: peh-oe-ji',	})

self:check_FOO({		pagename = '児',		lect = false,		pre = '停[仃]兒[児]，児，児[儿]',		post = {			'停兒，児，児',			'仃児，児，儿',			'vēvē, vē, vē',		},		com = 'syntax test: auto bolding and change simplified',	}) end return tests