Module:grc-utilities/sandbox/testcases
Appearance
- පහත දැක්වෙන උපදෙස්, Module:grc-utilities/sandbox/testcases/documentation හි පිහිටා ඇත. Module:grc-utilities/sandbox/testcases/documentation]]. [සංස්කරණය]
- ප්රයෝජනවත් සබැඳි: root page • root page’s subpages • සබැඳි • transclusions • tested module • sandbox of (වෙනස)
All tests passed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
ἐᾱ́ν | ἐάν | ἐάν | |
ᾰ̓́νερ | ἄνερ | ἄνερ | |
Πηληῐ̈ᾰ́δης | Πηληϊάδης | Πηληϊάδης | |
Ᾱ̔́ͅδης | ᾍδης | ᾍδης |
Text | Expected | Actual | |
---|---|---|---|
ἐᾱ́ν | ΕΑΝ | ΕΑΝ | |
ᾰ̓́νερ | ΑΝΕΡ | ΑΝΕΡ | |
Πηληῐ̈ᾰ́δης | ΠΗΛΗΙΑΔΗΣ | ΠΗΛΗΙΑΔΗΣ | |
Ᾱ̔́ͅδης | ΑΔΗΣ | ΑΔΗΣ |
local tests = require("Module:UnitTests")
local m_utilities_sandbox = require("Module:grc-utilities/sandbox")
local makeSortKey = m_utilities_sandbox.makeSortKey
local makeEntryName = m_utilities_sandbox.makeEntryName
local normalize = mw.ustring.toNFD
--[=[
-- Compare functions in [[Module:languages]].
local grc = require("Module:languages").getByCode("grc")
local function makeSortKey(text)
return grc:makeSortKey(text)
end
local function makeEntryName(text)
return grc:makeEntryName(text)
end
--]=]
local function tag(text)
return '<span class="polytonic" lang="grc">' .. text .. '</span>'
end
local options = { display = tag }
function tests:check(func)
return function (self, example, expected)
self:equals(tag(example), normalize(func(example)), normalize(expected), options)
end
end
function tests:testMakeEntryName()
local examples = {
{ "ἐᾱ́ν", "ἐάν" },
{ "ᾰ̓́νερ", "ἄνερ" },
{ "Πηληῐ̈ᾰ́δης", "Πηληϊάδης" },
{ "Ᾱ̔́ͅδης", "ᾍδης" },
--[[
{ "", "" },
{ "", "" },
--]]
}
self:iterate(examples, self:check(makeEntryName))
end
function tests:testMakeSortKey()
local examples = {
{ "ἐᾱ́ν", "ΕΑΝ" },
{ "ᾰ̓́νερ", "ΑΝΕΡ" },
{ "Πηληῐ̈ᾰ́δης", "ΠΗΛΗΙΑΔΗΣ" },
{ "Ᾱ̔́ͅδης", "ΑΔΗΣ" },
--[[
{ "", "" },
{ "", "" },
--]]
}
self:iterate(examples, self:check(makeSortKey))
end
return tests