Module:User:Geographyinitiative/tongyong/testcases

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

This is a private module sandbox of Geographyinitiative, for their own experimentation. Items in this module may be added and removed at Geographyinitiative's discretion; do not rely on this module's stability.


local p = require('Module:UnitTests')
local m_pron = require('Module:User:Geographyinitiative/tongyong')
 

function p:tongyong(text, expected)
	self:equals(text, m_pron.py_tongyong(text), expected)
end

function p:test_tongyong()
	local examples = {
		{ 'qīnghǎi','cinghǎi' },
		{ 'fújiàn','fwujiann' },
		{ 'guǎngdōng','goangdong' },
		{ 'héběi','herbeei' },
		{ 'húnán','hwunan' },
		{ 'zhèjiāng','jehjiang' },
		{ 'nèiménggǔ','neymengguu' },
		{ 'shǎnxī','shaanshi' },
		{ 'xīnjiāng','shinjiang' },
		{ 'xīzàng','shitzanq' },
		{ 'sìchuān','syhchuan' },
	}
	self:iterate(examples, 'tongyong')
end