Module:dialect synonyms/testcases

local tests = require('Module:UnitTests') local m = require('Module:dialect synonyms') local m_links = require('Module:links') local m_languages = require('Module:languages') local m_etymology_languages = require('Module:etymology languages')

function tests:equalsC(name, actual, expected, options) return self:equals(name, mw.ustring.toNFC(actual), mw.ustring.toNFC(expected), options) end

function tests:test_ko local ko = m_languages.getByCode('ko') local vs = { ['Seoul'] = { name = 'Seoul', code = 'ko-c', code_main = 'ko', parent = {}, },		['SE test'] = { name = 'SE test', code = 'ko-se', code_main = 'ko', parent = {}, },		['NE test'] = { name = 'NE test', code = 'ko-ne', code_main = 'ko', parent = {}, },	}

self:equalsC(		'(Seoul) ae-e merger',		m.format_word(vs['Seoul'], '개 게'),		m_links.full_link({ lang = ko, term = '개 게', tr = 'ge ge', })	)	self:equalsC(		'(SE) default pitch (on penultimate syllable)',		m.format_word(vs['SE test'], '가나다'),		m.format_word(vs['SE test'], '가\'나다')	) self:equalsC(		'(NE) default pitch (on final syllable)',		m.format_word(vs['NE test'], '가나다'),		m.format_word(vs['NE test'], '가나\'다')	) self:equalsC(		'(SE) default pitch, length',		m.format_word(vs['SE test'], '가나@다'),		m.format_word(vs['SE test'], '가\'나@다')	) self:equalsC(		'(SE) default pitch, nasal',		m.format_word(vs['SE test'], '가나~다'),		m_links.full_link({ lang = ko, term = '가낭다', tr = 'gànã́dà', })	)	self:equalsC(		'(SE) default pitch, nasal, length',		m.format_word(vs['SE test'], '가나@~다'),		m_links.full_link({ lang = ko, term = '가낭다', tr = 'gànã́:dà', })	)	self:equalsC(		'(SE) -',		m.format_word(vs['SE test'], '가'),		m_links.full_link({ lang = ko, term = '가', tr = 'gà', })	)	self:equalsC(		'(SE) default pitch, length',		m.format_word(vs['SE test'], '가@'),		m_links.full_link({ lang = ko, term = '가', tr = 'gà:', })	)	self:equalsC(		'(SE) default pitch, length, w/ digraph vowel, closed syllable',		m.format_word(vs['SE test'], '금@'),		m_links.full_link({ lang = ko, term = '금', tr = 'gèu:m', })	)	self:equalsC(		'(SE) pitch',		m.format_word(vs['SE test'], '가'),		m_links.full_link({ lang = ko, term = '가', tr = 'gà', })	)	self:equalsC(		'(SE) pitch, length',		m.format_word(vs['SE test'], '가@'),		m_links.full_link({ lang = ko, term = '가', tr = 'gà:', })	)	self:equalsC(		'(SE) pitch, length, w/ digraph vowel, closed syllable',		m.format_word(vs['SE test'], '금@'),		m_links.full_link({ lang = ko, term = '금', tr = 'gèu:m', })	)	self:equalsC(		'(SE) nasal',		m.format_word(vs['SE test'], '나~'),		m_links.full_link({ lang = ko, term = '낭', tr = 'nã̀', })	)	self:equalsC(		'(SE) nasal, length (@~)',		m.format_word(vs['SE test'], '나@~'),		m_links.full_link({ lang = ko, term = '낭', tr = 'nã̀:', })	)	self:equalsC(		'(SE) nasal, length (~@)',		m.format_word(vs['SE test'], '나~@'),		m_links.full_link({ lang = ko, term = '낭', tr = 'nã̀:', })	)	self:equalsC(		'(SE) nasal, w/ digraph vowel',		m.format_word(vs['SE test'], '으~'),		m_links.full_link({ lang = ko, term = '응', tr = 'ẽ̀u', })	)	self:equalsC(		'(SE) nasal, w/ non-digraph vowel sequence',		m.format_word(vs['SE test'], '아이~'),		m_links.full_link({ lang = ko, term = '아잉', tr = 'áĩ̀', })	)	self:equalsC(		'(SE) nasal, w/ closed syllable',		m.format_word(vs['SE test'], '늠~'),		'?'	) self:equalsC(		'(SE) weird markup order',		m.format_word(vs['SE test'], '가나\'@다'),		m.format_word(vs['SE test'], '가나@\'다')	) self:equalsC(		'(Seoul) nasal, dialect w/o nasalization',		m.format_word(vs['Seoul'], '나~'),		'?'	) self:equalsC(		'(Seoul) pitch, dialect w/o pitch',		m.format_word(vs['Seoul'], '\'나'),		'?'	) end

return tests