Jump to content

Module:grc-translit/sandbox/testcases

Wiktionary වෙතින්

2 of 35 tests failed. (refresh)

TextExpectedActual
test_links:
PassedΛΌΓΟΣLÓGOSLÓGOS
FailedΟἿΑΙHOÎAIHoîAi
FailedῬΉΤΩΡRHḖTŌRRhḖTŌR
Passedλόγοςlógoslógos
Passedσφίγξsphínxsphínx
Passedϝάναξwánaxwánax
Passedοἷαιhoîaihoîai
Passedταῦροςtaûrostaûros
Passedνηῦςnēûsnēûs
Passedσῦςsûssûs
Passedὗςhûshûs
Passedγυῖονguîonguîon
Passedἀναῡ̈τέωanaṻtéōanaṻtéō
Passedδαΐφρωνdaḯphrōndaḯphrōn
Passedτῶνtôntôn
Passedτοὶtoìtoì
Passedτῷtôitôi
Passedτούτῳtoútōitoútōi
Passedσοφίᾳsophíāisophíāi
Passedμᾱ̆νόςmānósmānós
Passedhoho
Passedοἱhoihoi
Passedεὕρισκεheúriskeheúriske
Passedὑϊκόςhuïkóshuïkós
Passedπυρρόςpurrhóspurrhós
Passedῥέωrhéōrhéō
Passedσάἁμονsáhamonsáhamon
PassedὈδυσσεύςOdusseúsOdusseús
PassedΕἵλωςHeílōsHeílōs
PassedᾍδηςHā́idēsHā́idēs
Passedἡ Ἑλήνηhē Helḗnēhē Helḗnē
Passed𐠠𐠒𐠯𐠗pi-lo-ti-mopi-lo-ti-mo
Passedἔχεις μοι εἰπεῖν, ὦ Σώκρατες, ἆρα διδακτὸν ἡ ἀρετή;ékheis moi eipeîn, ô Sṓkrates, âra didaktòn hē aretḗ?ékheis moi eipeîn, ô Sṓkrates, âra didaktòn hē aretḗ?
Passedτί τηνικάδε ἀφῖξαι, ὦ Κρίτων; ἢ οὐ πρῲ ἔτι ἐστίν;tí tēnikáde aphîxai, ô Krítōn? ḕ ou prṑi éti estín?tí tēnikáde aphîxai, ô Krítōn? ḕ ou prṑi éti estín?
Passedτούτων φωνήεντα μέν ἐστιν ἑπτά· α ε η ι ο υ ω.toútōn phōnḗenta mén estin heptá; a e ē i o u ō.toútōn phōnḗenta mén estin heptá; a e ē i o u ō.

--[=[
	Unit tests for [[Module:grc-translit/sandbox]].
]=]

local tests = require('Module:UnitTests')
local transliterate = require('Module:grc-translit/sandbox').tr
local m_util = require('Module:utilities')
local tag = require('Module:grc-utilities').tag
local compose = mw.ustring.toNFC

local lang = "grc"

local function check_output(term, expected, sc)
	tests:equals(
		tag(term),
		compose(transliterate(term, lang, sc)),
		compose(expected)
	)
end

local function iterate(list)
	for i, example in pairs(list) do
		check_output(example[1], example[2], example[3])
	end
end

function tests:test_links()
	local examples = {
		-- all-caps
		{ 'ΛΌΓΟΣ', 'LÓGOS' },
		{ 'ΟἿΑΙ', 'HOÎAI' },
		{ 'ῬΉΤΩΡ', 'RHḖTŌR' },
		
		{ 'λόγος', 'lógos' },
		{ 'σφίγξ', 'sphínx' },
		{ 'ϝάναξ', 'wánax' },
		{ 'οἷαι', 'hoîai' },
		
		-- test u/y
		{ 'ταῦρος', 'taûros' },
		{ 'νηῦς', 'nēûs' },
		{ 'σῦς', 'sûs' },
		{ 'ὗς', 'hûs' },
		{ 'γυῖον', 'guîon' },
		{ 'ἀναῡ̈τέω', 'anaṻtéō' },
		{ 'δαΐφρων', 'daḯphrōn' },
		
		-- test length
		{ 'τῶν', 'tôn' },
		{ 'τοὶ', 'toì' },
		{ 'τῷ', 'tôi' },
		{ 'τούτῳ', 'toútōi' },
		{ 'σοφίᾳ', 'sophíāi' },
		{ 'μᾱ̆νός', 'mānós' }, -- should perhaps be mā̆nos
		
		-- test h
		{ 'ὁ', 'ho' },
		{ 'οἱ', 'hoi' },
		{ 'εὕρισκε', 'heúriske' },
		{ 'ὑϊκός', 'huïkós' },
		{ 'πυρρός', 'purrhós' },
		{ 'ῥέω', 'rhéō' },
		{ 'σάἁμον', 'sáhamon' },
	
		-- test capitals
		{ 'Ὀδυσσεύς', 'Odusseús' },
		{ 'Εἵλως', 'Heílōs' },
		{ 'ᾍδης', 'Hā́idēs' },
		{ 'ἡ Ἑλήνη', 'hē Helḗnē' },
		{ '𐠠𐠒𐠯𐠗', 'pi-lo-ti-mo', "Cprt" },
		
		-- punctuation
		{ 'ἔχεις μοι εἰπεῖν, ὦ Σώκρατες, ἆρα διδακτὸν ἡ ἀρετή;', 'ékheis moi eipeîn, ô Sṓkrates, âra didaktòn hē aretḗ?'},
		{ 'τί τηνικάδε ἀφῖξαι, ὦ Κρίτων; ἢ οὐ πρῲ ἔτι ἐστίν;', 'tí tēnikáde aphîxai, ô Krítōn? ḕ ou prṑi éti estín?' },
		-- This ought to be colon, but sadly that cannot be.
		{ 'τούτων φωνήεντα μέν ἐστιν ἑπτά· α ε η ι ο υ ω.', 'toútōn phōnḗenta mén estin heptá; a e ē i o u ō.' },
	}
	
	iterate(examples)
end

return tests
"https://si.wiktionary.org/w/index.php?title=Module:grc-translit/sandbox/testcases&oldid=26161" වෙතින් සම්ප්‍රවේශනය කෙරිණි