Module:ar-entryname/testcases

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

All tests passed. (refresh)

TextExpectedActualDiffers at
test_makeEntryName:
Passedهُوَهوهو
Passedكَانَكانكان
Passedٱلْمَغْرِبالمغربالمغرب
Passedآلِهَةٍآلهةآلهة
Passedقُوَّةًقوةقوة
Passedمَرِيـــــــضٌمريضمريض
Passedلٰكِنَّلكنلكن
Passedـــ
Passedــُـً

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

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

function tests:test_makeEntryName()
	self:iterate({
		{ "هُوَ", "هو" },
		{ "كَانَ", "كان" },
		{ "ٱلْمَغْرِب", "المغرب" },
		{ "آلِهَةٍ", "آلهة" },
		{ "قُوَّةً", "قوة" },
		{ "مَرِيـــــــضٌ", "مريض" },
		{ "لٰكِنَّ", "لكن" },
		{ "ـــ", "" },
		{ "ــُـً", "" },
	},
	function(self, example, expected)
		self:equals(tag(example), makeEntryName(example), expected)
	end)
end

return tests