Module:User:Erutuon/grc/testcases
Appearance
- The following documentation is located at Module:User:Erutuon/grc/testcases/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • user page • user talk page • userspace
3 of 18 tests failed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
πῑ́πτων | πῑ́πτουσᾰ, πῖπτον (1&3, πῑ́πτω) | πῑ́πτουσᾰ, πῖπτον (1&3, πῑ́πτω) | |
λᾰβών | λᾰβοῦσᾰ, λᾰβόν (1&3, ?) | λᾰβοῦσᾰ, λᾰβόν (1&3, ?) | |
τῑμῶν | τῑμῶσᾰ, τῑμῶν (1&3, τῑμᾰ́ω) | τῑμῶσᾰ, τῑμῶν (1&3, τῑμᾰ́ω) | |
ποιῶν | ποιοῦσᾰ, ποιοῦν (1&3, ποιέω) | ποιοῦσᾰ, ποιοῦν (1&3, ποιέω) | |
δηλῶν | δηλοῦσᾰ, δηλοῦν (1&3, δηλόω) | δηλοῦσᾰ, δηλοῦν (1&3, δηλόω) | |
εἰδώς | εἰδυῖᾰ, εἰδός (1&3, ?) | εἰδυῖᾰ, εἰδός (1&3, ?) | |
λεγόμενος | λεγομένη, λεγόμενον (1&2, λέγω) | λεγομένη, λεγόμενον (1&2, λέγω) | |
θείς | θεῖσᾰ, θέν (1&3, ?) | θεῖσᾰ, θέν (1&3, ?) | |
ᾰ̓ξῐώσᾱς | ᾰ̓ξῐώσᾱσᾰ, ᾰ̓ξῐῶσᾰν (1&3, ?) | ᾰ̓ξῐώσᾱσᾰ, ᾰ̓ξῐῶσᾰν (1&3, ?) |
Text | Expected | Actual | |
---|---|---|---|
Λεωνίδης (noun) | Λ, ε, ω, ν, ί, δ, η, ς | Λ, ε, ω, ν, ί, δ, η, ς | |
ἀληθέι | ἀ, λ, η, θ, έ, ι | ἀ, λ, η, θ, έ, ι | |
πόλεως (noun) | π, ό, λ, εω, ς | π, ό, λ, ε, ω, ς | |
πόλεων (noun) | π, ό, λ, εω, ν | π, ό, λ, ε, ω, ν | |
οἷαι | οἷ, αι | οἷ, αι | |
ΟἿΑΙ | ΟἿ, ΑΙ | ΟἿ, ΑΙ | |
Αἰσχύλος | Αἰ, σχ, ύ, λ, ο, ς | Αἰ, σ, χ, ύ, λ, ο, ς | |
ἀναῡ̈τέω | ἀ, ν, α, ῡ̈, τ, έ, ω | ἀ, ν, α, ῡ̈, τ, έ, ω | |
τούτῳ | τ, ού, τ, ῳ | τ, ού, τ, ῳ |
local tests = require("Module:UnitTests")
local m_grc = require("Module:User:Erutuon/grc")
local tokenize = m_grc.tokenize
local get_participle_information = m_grc.get_participle_information
local tag = require("Module:grc-utilities").tag
local compose = mw.ustring.toNFC
local function displayTokenization(example, isNoun)
return table.concat(tokenize(example, isNoun), ", ")
end
function tests:check_tokenize(example, expected, isNoun)
self:equals(
tag(example) .. (isNoun and " (noun)" or ""),
compose(displayTokenization(example, isNoun)),
compose(expected),
{ display = tag, show_difference = true }
)
end
local function show_participle_information(decl, feminine, neuter, lemma)
decl, feminine, neuter, lemma = decl or "?", feminine or "?", neuter or "?", lemma or "?"
return mw.ustring.toNFC(tag(feminine) .. ", " .. tag(neuter) .. " (" .. decl
.. ", " .. tag(lemma) .. ")")
end
local options = { show_difference = true }
function tests:check_get_participle_information(example, contraction_vowel, expected)
self:equals(
tag(example),
show_participle_information(get_participle_information(example, contraction_vowel)),
show_participle_information(unpack(expected)),
options)
end
function tests:test_get_participle_information()
local examples = {
{ "πῑ́πτων", nil, { "1&3", "πῑ́πτουσᾰ", "πῖπτον", "πῑ́πτω" } },
{ "λᾰβών", nil, { "1&3", "λᾰβοῦσᾰ", "λᾰβόν", nil } },
{ "τῑμῶν", "a", { "1&3", "τῑμῶσᾰ", "τῑμῶν", "τῑμᾰ́ω" } },
{ "ποιῶν", "e", { "1&3", "ποιοῦσᾰ", "ποιοῦν", "ποιέω" } },
{ "δηλῶν", "o", { "1&3", "δηλοῦσᾰ", "δηλοῦν", "δηλόω" } },
{ "εἰδώς", nil, { "1&3", "εἰδυῖᾰ", "εἰδός", nil } },
{ "λεγόμενος", nil, { "1&2", "λεγομένη", "λεγόμενον", "λέγω" } },
{ "θείς", nil, { "1&3", "θεῖσᾰ", "θέν", nil } },
{ "ᾰ̓ξῐώσᾱς", nil, { "1&3", "ᾰ̓ξῐώσᾱσᾰ", "ᾰ̓ξῐῶσᾰν", nil } },
}
self:iterate(examples, "check_get_participle_information")
end
function tests:test_tokenize()
local examples = {
{ "Λεωνίδης", "Λ, ε, ω, ν, ί, δ, η, ς", true },
{ "ἀληθέι", "ἀ, λ, η, θ, έ, ι" },
{ "πόλεως", "π, ό, λ, εω, ς", true },
{ "πόλεων", "π, ό, λ, εω, ν", true },
{ "οἷαι", "οἷ, αι" },
{ "ΟἿΑΙ", "ΟἿ, ΑΙ" },
{ "Αἰσχύλος", "Αἰ, σχ, ύ, λ, ο, ς" },
{ "ἀναῡ̈τέω", "ἀ, ν, α, ῡ̈, τ, έ, ω"},
{ "τούτῳ", "τ, ού, τ, ῳ" },
}
self:iterate(examples, "check_tokenize")
end
return tests