Jump to content

Module:User:Awesomemeeos/farsiexperimental2/testcases

From Wiktionary, the free dictionary

This is the unit-testing module for Module:User:Awesomemeeos/farsiexperimental2.

1 of 0 tests failed. (refresh)

TextExpectedActualDiffers at
test_translit_persian:
Script error during testing: Module:links:794: The first argument to the function full_link must be a table. See Module:links/documentation for more information.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:links:794: in function 'full_link'
	Module:User:Awesomemeeos/farsiexperimental2/testcases:6: in function 'do_test_translit'
	Module:User:Awesomemeeos/farsiexperimental2/testcases:10: in function <Module:User:Awesomemeeos/farsiexperimental2/testcases:9>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:370: in function <Module:UnitTests:329>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:896: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

local tests = require('Module:UnitTests')
local fa_translit = require('Module:User:Awesomemeeos/farsiexperimental2')
local m_links = require('Module:links')

function tests:do_test_translit(Pers, roman, xlit)
	self:equals(m_links.full_link(Pers, nil, require('Module:languages').getByCode('fa'), nil, nil, nil, {}, true), fa_translit.tr(Pers, 'fa', 'fa-Arab'), roman)
end

function tests:test_translit_persian()
	self:do_test_translit('ـَ', "a")
	self:do_test_translit('ـَه', "a")
	self:do_test_translit('ـا', "â")
	self:do_test_translit('آ', "â")
	self:do_test_translit('ىٰ', "â")
end	

return tests