Jump to content

Module:Syrc-entryname/testcases

From Wiktionary, the free dictionary

All tests passed. (refresh)

TextExpectedActualDiffers at
test_makeEntryName:
Passedܠܹܗܠܗܠܗ
Passedܡ̣ܢܡܢܡܢ
Passedܠܗܘܿܢܠܗܘܢܠܗܘܢ
Passedܒܸܬܒܬܒܬ
Passedܝܠܹܗܝܠܗܝܠܗ
Passedܣܵܒܵܒܣܒܒܣܒܒ
Passedܐܝܼܢܵܐܐܝܢܐܐܝܢܐ
Passedܠܹܐܠܐܠܐ
Passedܟܹܐܟܐܟܐ
Passedܠܝܼܠܝܠܝ
Passedܠܵܐܠܐܠܐ
Passedܓܵܘܓܘܓܘ
Passedܝܼܫܘܿܥܝܫܘܥܝܫܘܥ
Passedܗ̇ܘܗܘܗܘ
Passedܐܵܗܵܐܐܗܐܐܗܐ
Passedܐܲܩܠܵܐܐܩܠܐܐܩܠܐ
Passedܬܸܦ̮ܠܵܐܬܦܠܐܬܦܠܐ
Passedܓ̰ܵܘܹܓ̰ܓܘܓܓܘܓ
Passedܡܲܕܢ̱ܚܵܐܡܕܢܚܐܡܕܢܚܐ
Passedܡܲܩܕ̄ܫܵܐܡܩܕܫܐܡܩܕܫܐ
Passedܫ̃ܫܫ

local tests = require("Module:UnitTests")
local makeEntryName = require "Module:Syrc-entryname".makeEntryName

local function tag(text)
	return '<span>' .. text .. '</span>'
end

function tests:test_makeEntryName()
	self:iterate({
		-- common words
		{ "ܠܹܗ", "ܠܗ" },
		{ "ܡ̣ܢ", "ܡܢ" },
		{ "ܠܗܘܿܢ", "ܠܗܘܢ" },
		{ "ܒܸܬ", "ܒܬ" },
		{ "ܝܠܹܗ", "ܝܠܗ" },
		{ "ܣܵܒܵܒ", "ܣܒܒ" },
		{ "ܐܝܼܢܵܐ", "ܐܝܢܐ" },
		{ "ܠܹܐ", "ܠܐ" },
		{ "ܟܹܐ", "ܟܐ" },
		{ "ܠܝܼ", "ܠܝ" },
		{ "ܠܵܐ", "ܠܐ" },
		{ "ܓܵܘ", "ܓܘ" },
		{ "ܝܼܫܘܿܥ", "ܝܫܘܥ" },
		{ "ܗ̇ܘ", "ܗܘ" },
		{ "ܐܵܗܵܐ", "ܐܗܐ" },
		-- { "", "" },
		-- edge cases
		{ "ܐܲܩܠܵܐ", "ܐܩܠܐ" },
		{ "ܬܸܦ̮ܠܵܐ", "ܬܦܠܐ" },
		{ "ܓ̰ܵܘܹܓ̰", "ܓܘܓ" },
		{ "ܡܲܕܢ̱ܚܵܐ", "ܡܕܢܚܐ" },
		{ "ܡܲܩܕ̄ܫܵܐ", "ܡܩܕܫܐ" },
		{ "ܫ̃", "ܫ" },
	},
	function(self, example, expected)
		self:equals(tag(example), makeEntryName(example), expected)
	end)
end

return tests