Module:User:Oyunqi/ug-headword2/testcases2

From Wiktionary, the free dictionary
Jump to navigation Jump to search

1 of 2 tests failed. (refresh)

TextExpectedActualDiffers atComments
test_headword_noun:
auto
Passedبالا (bala)بالىلاربالىلار
no changes
Failedبالا (bala)بالالاربالىلار4change=no

Lua error in Module:module_categorization at line 298: Could not infer any languages or scripts from root pagename 'User:Oyunqi'


-- Unit tests for [[Module:User:Oyunqi/ug-headword2]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local ug_headword = require('Module:User:Oyunqi/ug-headword2')
local full_link = require('Module:links').full_link
local lang = require('Module:languages').getByCode('ug')
local sc = require('Module:scripts').getByCode('ug-Arab')

local function link(term)
	return full_link{lang = lang, sc = sc, term = term}
end

function tests:do_test(pos)
	local work
	if pos == "noun" then
		local make_plural_noun = ug_headword.make_plural_noun
		function work(text)
			return make_plural_noun(text, '', 'yes')
		end
	elseif pos == "adjective" then
		--work = ug_headword.biblical
	end
	
	return function (self, text, expected_plural, comment)
		self:equals(link(text), work(text), expected_plural, {comment=comment})
	end
end

function tests:test_headword_noun()
	local examples = {
		"auto",
		{ 'بالا', "بالىلار" },
		"no changes",
		{ 'بالا', "بالالار" , "change=no" },
	}
	
	self:iterate(examples, self:do_test("noun"))
end
 
return tests