Module:User:Erutuon/zh-han/sandbox/testcases

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

Module error: No such module "zh-han/sandbox/testcases".

Lua error in Module:module_categorization at line 299: Could not infer any languages or scripts from root pagename 'User:Erutuon'


local tests = require "Module:UnitTests"

local as_and_sn_codes = {
	c = 'simplified Chinese', t = 'traditional Chinese', m = 'mainland Chinese',
	j = 'Japanese', k = 'Korean',
}

local sorted_pairs = require "Module:table".sortedPairs
local function print_parameters(parameters)
	local output = require "Module:array"()
	for k, v in sorted_pairs(parameters) do
		output:insert(mw.text.nowiki "|" .. k .. "=" .. v)
	end
	return output:concat()
end

local function print_result(result)
	local output = require "Module:array"()
	for k, v in sorted_pairs(result) do
		output:insert((as_and_sn_codes or k) .. ": " .. v)
	end
	return output:concat(", ")
end

function tests:test_sn()
	local examples = {
		{ { sn = 4,  = 3 }, { t = 4, k = 4, c = 3, j = 3 } },
	}
	
	self:iterate(
		examples,
		function (self, parameters, expected)
			mw.logObject(parameters, "parameters")
			mw.logObject(expected, "expected")
			
			self:equals(print_parameters(parameters), print_result(expected), print_result({}))
		end)
end

return tests