Module:utilities/testcases

Hello, you have come here looking for the meaning of the word Module:utilities/testcases. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:utilities/testcases, but we will also tell you about its etymology, its characteristics and you will know how to say Module:utilities/testcases in singular and plural. Everything you need to know about the word Module:utilities/testcases you have here. The definition of the word Module:utilities/testcases will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:utilities/testcases, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

5 of 5 tests failed. (refresh)

TextExpectedActual
test_format_categories:
FailedEnglish lemmas (en, cliché)[[Category:English lemmas|CLICHE]][[Category:English lemmas|TESTCASES]]
FailedEnglish lemmas (en, Reconstruction:Proto-Indo-European/dn̥ǵʰwéh₂s)[[Category:English lemmas|DN̥ǴʰWEH₂S]][[Category:English lemmas|TESTCASES]]
FailedEnglish lemmas (en, Appendix:English doublets)[[Category:English lemmas|ENGLISH DOUBLETS]][[Category:English lemmas|TESTCASES]]
FailedEnglish lemmas (en, Citations:word)[[Category:English lemmas|WORD]][[Category:English lemmas|TESTCASES]]
FailedEnglish lemmas (en, Wiktionary:Grease pit)[[Category:English lemmas|TESTCASES]]

local tests = require("Module:UnitTests")

local languages = require("Module:languages/cache")
local format_categories = require("Module:utilities").format_categories

local currentTitle
local function specialGetCurrentTitle()
	return currentTitle
end

function tests:test_format_categories()
	local examples = {
		{ "English lemmas", "en", "cliché", "]" },
		{ "English lemmas", "en", "Reconstruction:Proto-Indo-European/dn̥ǵʰwéh₂s", "]" },
		{ "English lemmas", "en", "Appendix:English doublets", "]" },
		{ "English lemmas", "en", "Citations:word", "]" },
		{ "English lemmas", "en", "Wiktionary:Grease pit", "" },
	}
	
	local actualGetCurrentTitle = mw.title.getCurrentTitle
	mw.title.getCurrentTitle = specialGetCurrentTitle
	
	local options = { display = mw.text.nowiki }
	
	self:iterate(examples,
		function (self, category, lang, title, expected)
			currentTitle = mw.title.new(title)
			self:equals(
				category .. " (" .. lang .. ", ])",
				format_categories({ category }, languages),
				expected,
				options)
		end)
	
	mw.title.getCurrentTitle = actualGetCurrentTitle
end

return tests