Module:User:Erutuon/script recognition/testcases
Jump to navigation
Jump to search
- The following documentation is located at Module:User:Erutuon/script recognition/testcases/documentation. [edit] Categories were auto-generated by Module:documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • user page • user talk page • userspace
All tests passed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
A | Latn | Latn | |
一 | Hani | Hani | |
ώ | Grek | Grek | |
ὦ | polytonic | polytonic | |
Ж | Cyrl | Cyrl | |
Ѹ | Cyrs | Cyrs | |
ꙑ | Cyrs | Cyrs | |
! | (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