Module:User:Kutchkutch/mr-decl/testcases

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

Formal tests

These tests are currently in development, and should not be relied upon. 1 of 0 tests failed. (refresh)

TextExpectedActual
test_details:
Script error during testing: Module:User:Kutchkutch/mr-decl/testcases:272: attempt to call field 'findBestScript' (a nil value)
stack traceback:
	: in function 'findBestScript'
	Module:User:Kutchkutch/mr-decl/testcases:272: in function <Module:User:Kutchkutch/mr-decl/testcases:270>
	(tail call): ?
	(tail call): ?
	: in function 'xpcall'
	Module:fun/xpcall:37: in function 'xpcall'
	Module:UnitTests:389: in function <Module:UnitTests:350>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	: ?
	: in function 'expandTemplate'
	mw.lua:333: in function <mw.lua:307>
	(tail call): ?
	(tail call): ?
	Module:documentation:1040: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	: ?

Visual Tests

The test must be performed by inspecting the generated tables. It is a stop-gap until automated testing can be implemented.

See User:Kutchkutch/mr-decl


local tests = require('Module:UnitTests')

local m_links = require("Module:links")
local lang = require("Module:languages").getByCode("mr")
local m_scripts = require("Module:scripts")
local m_decl_noun = require('Module:User:Kutchkutch/mr-decl')

local frame = mw.getCurrentFrame()
local ti = table.insert
local gsub = mw.ustring.gsub

local dialect_name = {
	mr = 'Marathi',
}
-- local casetc = {'nom. s.', 'nom. p.', 'obl. s.', 'obl. p.'}
local casetc = {dirs = 'nom. s.', dirp = 'nom. p,', obls = 'obl. s.', oblp = 'obl. p.',
				dats = 'dat. s.', datp = 'dat. s.', ergs = 'erg. s.', ergp = 'erg. p.',
				inss = 'ins. s.', insp = 'ins. p.', locs = 'loc. s.', locp = 'loc. p.',
				vocs = 'voc. s.', vocp = 'voc. p.', gso = 'gen. obl. s.', gpo = 'gen. obl. p.',
-- I hope the numbers are the right way round!
				gsns = 'gen. s. n. s.', gsms = 'gen. s. m. s.', gsfs = 'gen. s. f. s.',
				gsnp = 'gen. s. n. p.', gsmp = 'gen. s. m. p.', gsfp = 'gen. s. f. p.',
				gpns = 'gen. p. n. s.', gpms = 'gen. p. m. s.', gpfs = 'gen. p. f. s.',
				gpnp = 'gen. p. n. p.', gpmp = 'gen. p. m. p.', gpfp = 'gen. p. f. p.',
}
local detail_items = {
	-- First element is one of the following:
	-- 'dialect' selects dialect to be tested.
	-- 'm', 'f' or 'n', which gives word and gender.
	-- Case form code, which selects case and number to compare and
	-- gives expected form, both native script and Wiktionary Romanisation.
	{"dialect", "mr"},
	{'heading', "test tests"},
	{'datp', {"गागा", "zebra"}} , --Deliberately wrong, to test tests.

	{'heading', "Primary Tags"},
	{'heading', "marked masc cons-stem"},
	{"m", "हात"},
	{'dirs', {"हात", "hāt"}},
	{'dirp', {"हात", "hāt"}},
	{'obls', {"हाता", "hātā"}},
	{'dats', {"हाताला", "hātālā"}},
	{'datp', {"हातांना", "hātānnā"}},
	{'ergs', {"हाताने", "hātāne"}},
	{'ergp', {"हातांनी", "hātānnī"}},
	{'gsns', {"हाताच़े", "hātāċe"}, {"हाताच़ं", "hātāċa"}},
	{'gpns', {"हातांच़े", "hātāñċe"}, {"हातांच़ं", "hātāñċa"}},
	{'heading', "marked fem-e cons-stem"},
	{"f-e", "वाट"},
	{'dirs', {"वाट", "vāṭ"}},
	{'dirp', {"वाटा", "vāṭā"}},
	{'obls', {"वाटे", "vāṭe"}},
	{'oblp', {"वाटां", "vāṭā̃"}},
	{'heading', "marked fem cons-stem"},
	{"f", "नात"},
	{'dirs', {"नात", "nāt"}},
	{'dirp', {"नाती", "nātī"}},
	{'obls', {"नाती", "nātī"}},
	{'oblp', {"नातीं", "nātī̃"}},
	{'heading', "marked neut cons-stem"},
	{"n", "घर"},
	{'dirs', {"घर", "ghar"}},
	{'dirp', {"घरे", "ghare"}, {"घरं", "ghara"}},
	{'obls', {"घरा", "gharā"}},
	{'oblp', {"घरां", "gharā̃"}},
	{'heading', "marked masc ā-stem"},
	{"m", "माळा"},
	{'dirs', {"माळा", "māḷā"}},
	{'dirp', {"माळे", "māḷe"}},
	{'obls', {"माळ्या", "māḷyā"}},
	{'oblp', {"माळ्यां", "māḷyā̃"}},
	{'heading', "marked fem ā-stem"},
	{"f", "शाळा"},
	{'dirs', {"शाळा", "śāḷā"}},
	{'dirp', {"शाळा", "śāḷā"}},
	{'obls', {"शाळे", "śāḷe"}},
	{'oblp', {"शाळां", "śāḷā̃"}},
	{'heading', "marked masc ī-stem"},
	{"m", "शिंपी"},
	{'dirs', {"शिंपी", "śimpī"}},
	{'dirp', {"शिंपी", "śimpī"}},
	{'obls', {"शिंप्या", "śimpyā"}},
	{'oblp', {"शिंप्यां", "śimpyā̃"}},
	{'heading', "marked feminine ī-stem"},
	{"f", "गाडी"},
	{'dirs', {"गाडी", "gāḍī"}},
	{'dirp', {"गाड्या", "gāḍyā"}},
	{'obls', {"गाडी", "gāḍī"}},
	{'oblp', {"गाड्यां", "gāḍyā̃"}},
	{'heading', "marked neut ī-stem"},
	{"n", "दही"},
	{'dirs', {"दही", "dahī"}},
	{'dirp', {"दही", "dahī"}},
	{'obls', {"दह्या", "dahyā"}},
	{'oblp', {"दह्यां", "dahyā̃"}},
	{'heading', "marked masc ū-stem"},
	{"m", "नातू"},
	{'dirs', {"नातू", "nātū"}},
	{'dirp', {"नातू", "nātū"}},
	{'obls', {"नातवा", "nātvā"}},
	{'oblp', {"नातवां", "nātvā̃"}},
	{'heading', "marked fem ū-stem (obsolete)"},
	{"f", "सासू"},
	{'dirs', {"सासू", "sāsū"}},
	{'dirp', {"सासवा", "sāsvā"}},
	{'obls', {"सासवे", "sāsve"}},
	{'oblp', {"सासवां", "sāsvā̃"}},
	{'heading', "marked neut ū-stem"},
	{"n", "तारू"},
	{'dirs', {"तारू", "tārū"}},
	{'dirp', {"तारवे", "tārve"}, {"तारवं", "tārva"}},
	{'obls', {"तारवा", "tārvā"}},
	{'oblp', {"तारवां", "tārvā̃"}},
	{'heading', "masc r-stem"},
	{"m", "भर्तृ"},
	{'dirs', {"भर्तृ", "bhartru"}},
	{'dirp', {"भर्तृ", "bhartru"}},
	{'obls', {"भर्तृ", "bhartru"}},
	{'oblp', {"भर्तृं", "bhartrũ"}},
	{'heading', "feminine r-stem"},
	{"f", "मातृ"},
	{'dirs', {"मातृ", "mātru"}},
	{'dirp', {"मातृ", "mātru"}},
	{'obls', {"मातृ", "mātru"}},
	{'oblp', {"मातृं", "mātrũ"}},
	{'heading', "fem ai-stem"},
	{"f", "पै"},
	{'dirs', {"पै", "pai"}},
	{'dirp', {"पया", "payā"}},
	{'obls', {"पया", "payā"}},
	{'oblp', {"पयां", "payā̃"}},
	{'heading', "masc o-stem"},
	{"m", "धनको"},
	{'dirs', {"धनको", "dhanko"}},
	{'dirp', {"धनको", "dhanko"}},
	{'obls', {"धनको", "dhanko"}},
	{'oblp', {"धनकों", "dhankõ"}},
	{'heading', "feminine o-stem"},
	{"f", "बायको"},
	{'dirs', {"बायको", "bāyko"}},
	{'dirp', {"बायका", "bāykā"}},
	{'obls', {"बायको", "bāyko"}},
	{'oblp', {"बायकां", "bāykā̃"}},

	{'heading', "Subtags of masc cons-stem"},
	{'heading', "masc unmarked dependent-ī cons-stem (monosyllabic)"},
	{"m", "वीर"},
	{'dirs', {"वीर", "vīr"}},
	{'dirp', {"वीर", "vīr"}},
	{'obls', {"वीरा", "vīrā"}},
	{'oblp', {"वीरां", "vīrā̃"}},
	{'heading', "masc weakened dependent-ī cons-stem (polysyllabic)"},
	{"m", "वकील", { = "true"}},
	{'dirs', {"वकील", "vakīl"}},
	{'dirp', {"वकील", "vakīl"}},
	{'obls', {"वकिला", "vakilā"}},
	{'oblp', {"वकिलां", "vakilā̃"}},
	{'heading', "masc unmarked dependent-ū cons-stem (monosyllabic)"},
	{"m", "शूर"},
	{'dirs', {"शूर", "śūr"}},
	{'dirp', {"शूर", "śūr"}},
	{'obls', {"शूरा", "śūrā"}},
	{'oblp', {"शूरां", "śūrā̃"}},
	{'heading', "masc weakened dependent-ū cons-stem (polysyllabic)"},
	{"m", "कारकून", { = "true"}},
	{'dirs', {"कारकून", "kārkūn"}},
	{'dirp', {"कारकून", "kārkūn"}},
	{'obls', {"कारकुना", "kārkunā"}},
	{'oblp', {"कारकुनां", "kārkunā̃"}},
	{'heading', "masc weakened independent-ī cons-stem"},
	{"m", "पाईक", { = "true"}},
	{'dirs', {"पाईक", "pāīk"}},
	{'dirp', {"पाईक", "pāīk"}},
	{'obls', {"पाइका", "pāikā"}},
	{'oblp', {"पाइकां", "pāikā̃"}},
	{'heading', "masc weakened independent-ī cons-stem (polysyllabic)"},
	{"m", "नातेवाईक", { = "true"}},
	{'dirs', {"नातेवाईक", "nātevāīk"}},
	{'dirp', {"नातेवाईक", "nātevāīk"}},
	{'obls', {"नातेवाइका", "nātevāikā"}},
	{'oblp', {"नातेवाइकां", "nātevāikā̃"}},
	{'heading', "masc weakened independent-ū cons-stem (monosyllabic)"},
	{"m", "ऊस", { = "true"}},
	{'dirs', {"ऊस", "ūs"}},
	{'dirp', {"ऊस", "ūs"}},
	{'obls', {"उसा", "usā"}},
	{'oblp', {"उसां", "usā̃"}},
	{'heading', "masc weakened independent-ū cons-stem"},
	{"m", "राऊत", { = "true"}},
	{'dirs', {"राऊत", "rāūt"}},
	{'dirp', {"राऊत", "rāūt"}},
	{'obls', {"राउता", "rāutā"}},
	{'oblp', {"राउतां", "rāutā̃"}},

	{'heading', "Subtags of fem-e cons-stem"},
	{'heading', "fem-e weakened dependent-ī cons-stem (polysyllabic)"},
	{"f-e", "मोहीम", { = "true"}},
	{'dirs', {"मोहीम", "mohīm"}},
	{'dirp', {"मोहिमा", "mohimā"}},
	{'obls', {"मोहिमे", "mohime"}},
	{'oblp', {"मोहिमां", "mohimā̃"}},
	{'heading', "fem-e weakened independent-ī cons-stem (monosyllabic)"},
	{"f-e", "ईद", { = "true"}},
	{'dirs', {"ईद", "īd"}},
	{'dirp', {"इदा", "idā"}},
	{'obls', {"इदे", "ide"}},
	{'oblp', {"इदां", "idā̃"}},

	{'heading', "Subtags of fem cons-stem"},
	{'heading', "fem weakened dependent-ū cons-stem (polysyllabic)"},
	{"f", "कसूर", { = "true"}},
	{'dirs', {"कसूर", "kasūr"}},
	{'dirp', {"कसुरी", "kasurī"}},
	{'obls', {"कसुरी", "kasurī"}},
	{'oblp', {"कसुरीं", "kasurī̃"}},
	{'heading', "fem weakened independent-ī cons-stem (monosyllabic)"},
	{"f", "ईद", { = "true"}},
	{'dirs', {"ईद", "īd"}},
	{'dirp', {"इदी", "idī"}},
	{'obls', {"इदी", "idī"}},
	{'oblp', {"इदीं", "idī̃"}},
	{'heading', "fem weakened independent-ī cons-stem (monosyllabic)"},
	{"f", "पंचाईत", { = "true"}},
	{'dirs', {"पंचाईत", "pañcāīt"}},
	{'dirp', {"पंचाइती", "pañcāitī"}},
	{'obls', {"पंचाइती", "pañcāitī"}},
	{'oblp', {"पंचाइतीं", "pañcāitī̃"}},

	{'heading', "Subtags of neut cons-stem"},
	{'heading', "neut unmarked dependent-ī cons-stem (polysyllabic)"},
	{"n", "गणित"},
	{'dirs', {"गणित", "gaṇit"}},
	{'dirp', {"गणिते", "gaṇite"}, {"गणितं", "gaṇita"}},
	{'obls', {"गणिता", "gaṇitā"}},
	{'oblp', {"गणितां", "gaṇitā̃"}},
	{'heading', "neut weakened dependent-ī cons-stem (polysyllabic)"},
	{"n", "बक्षीस", { = "true"}},
	{'dirs', {"बक्षीस", "bakṣīs"}},
	{'dirp', {"बक्षिसे", "bakṣise"}, {"बक्षिसं", "bakṣisa"}},
	{'obls', {"बक्षिसा", "bakṣisā"}},
	{'oblp', {"बक्षिसां", "bakṣisā̃"}},
	{'heading', "neut weakened dependent-ū cons-stem (polysyllabic)"},
	{"n", "वारूळ", { = "true"}},
	{'dirs', {"वारूळ", "vārūḷ"}},
	{'dirp', {"वारुळे", "vāruḷe"}, {"वारुळं", "vāruḷa"}},
	{'obls', {"वारुळा", "vāruḷā"}},
	{'oblp', {"वारुळां", "vāruḷā̃"}},
	{'heading', "neut weakened independent-ī cons-stem (polysyllabic)"},
	{"n", "गिऱ्हाईक", { = "true"}},
	{'dirs', {"गिऱ्हाईक", "girhāīk"}},
	{'dirp', {"गिऱ्हाइके", "girhāike"}, {"गिऱ्हाइकं", "girhāika"}},
	{'obls', {"गिऱ्हाइका", "girhāikā"}},
	{'oblp', {"गिऱ्हाइकां", "girhāikā̃"}},

	{'heading', "Subtags of masc ā-stem"},
	{'heading', "sg-only masc ā-stem"},
	{"m", "गोवा", { = "sg-only"}},
	{'dirs', {"गोवा", "govā"}},
	{'dirp', {"-", "-"}},
	{'obls', {"गोव्या", "govyā"}},
	{'oblp', {"-", "-"}},
	{'heading', "masc rā-stem"},
	{"m", "मोगरा"},
	{'dirs', {"मोगरा", "mogrā"}},
	{'dirp', {"मोगरे", "mogre"}},
	{'obls', {"मोगऱ्या", "mogaryā"}},
	{'oblp', {"मोगऱ्यां", "mogaryā̃"}},
}

function tests:test_details()
	local word = "माळा"
	local sc = m_scripts.findBestScript(word, lang)
	local forms, translit_forms, stem, actual, exp
	local dialect = "mr"
	local gender ='m';
	local options = {{"weaken_iu", "no"}}
	local forms_got = false
	local formno
	forms = m_decl_noun.forms(word, gender)
	forms = m_decl_noun.forms('गागा', 'm') -- Just to get list of forms.
	for i, v in ipairs(detail_items) do
		if v == 'dialect' then
			dialect = v
			forms_got = false
		elseif v == 'heading' then
				tests:heading(v)
		elseif v == 'm' or v == 'f' or v == 'f-e' or v == 'n' then
			gender = v
			word = v
			options = v
			forms, translit_forms = m_decl_noun.forms(word, gender, options) -- Just in case nouns sometimes lack forms and
			                                                 -- this is not expressed by an empty list.
			forms_got = true
		elseif forms] then
			formno = v
			exp = {}
			for j = 2, #v do
				if j ~= 2 then
					ti(exp, 'or ')
				end
				ti(exp, v)
				ti(exp, ' (')
				ti(exp, v) -- Do we actually want to check transliterations?
				ti(exp, ') ')
			end
			exp = table.concat(exp)

			if not forms_got then
				forms, translit_forms = m_decl_noun.forms(word, gender)
				forms_got = true -- Local optimisation
			end
			actual = {}
			for j = 1, #forms] do
				if j ~= 1 then
					ti(actual, 'or ')
				end
				ti(actual, forms])
				ti(actual, ' (')
				ti(actual, translit_forms])
				ti(actual, ') ')
			end
			actual = table.concat(actual)
			local name = {}
			ti(name, '[[')
			ti(name, word)
			ti(name, '#Marathi|')
			ti(name, lang:transliterate(word, sc))
			ti(name, ']]')
			ti(name, ' ')
			ti(name, casetc)
			name = table.concat(name)
-- Compare and report.
-- Method summary: equals(name, actual, expected, options)
			tests:equals(name, actual, exp, {show_difference = true})
		else
			error('Test item '..i..' has invalid first element '..v)
		end
	end
end

return tests