Module:User:Erutuon/script recognition/testcases

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

All tests passed. (refresh)

TextExpectedActual
test_charToScript:
PassedALatnLatn
PassedHaniHani
PassedώGrekGrek
Passedpolytonicpolytonic
PassedЖCyrlCyrl
PassedѸCyrsCyrs
PassedCyrsCyrs
Passed!(nil)(nil)

local tests = require("Module:UnitTests")

local m_sc_recognition = require("Module:User:Erutuon/script_recognition")

function tests:check_charToScript(char, expected)
	self:equals(
		char,
		m_sc_recognition.charToScript(char),
		expected
	)
end

function tests:test_charToScript()
	local examples = {
		{ "A", "Latn" },
		{ "一", "Hani" },
		{ "ώ", "Grek" },
		{ "ὦ", "polytonic" },
		{ "Ж", "Cyrl" },
		{ "Ѹ", "Cyrs" },
		{ "ꙑ", "Cyrs" },
		{ "!", nil },
	}
	
	tests:iterate(examples, "check_charToScript")
end

return tests