Module:fa-ira-translit/testcases: difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
Guldrelokk (talk | contribs) No edit summary |
Guldrelokk (talk | contribs) No edit summary |
||
Line 24: | Line 24: | ||
{ 'عَصاً', "’asan" }, |
{ 'عَصاً', "’asan" }, |
||
{ 'خانه', "xâne" }, |
{ 'خانه', "xâne" }, |
||
{ ' |
{ 'خانَه', "xâne" }, |
||
{ 'کُرِۀ شُمالی', "kore-ye šomâli" }, |
{ 'کُرِۀ شُمالی', "kore-ye šomâli" }, |
||
{ 'ضَمّه', "zamme" }, |
{ 'ضَمّه', "zamme" }, |
Revision as of 12:19, 12 June 2018
- The following documentation is located at Module:fa-ira-translit/testcases/documentation. [edit] Categories were auto-generated by Module:module categorization. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • sandbox
This is the unit testing module for Module:fa-ira-translit.
Lua error in package.lua at line 80: module 'Module:fa-translit' not found
-- Unit tests for [[Module:fa-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local fa_translit = require('Module:fa-translit')
local m_links = require('Module:links')
local fa = require('Module:languages').getByCode('fa')
local function link(term)
return m_links.full_link{term = term, lang = fa}
end
function tests:do_test_translit(Pers, roman, xlit)
self:equals(link(Pers), fa_translit.tr(Pers, 'fa', 'fa-Arab'), roman)
end
function tests:test_translit_persian()
local examples = {
{ 'سَرانجام', "saranjâm" },
{ 'سَرانْجام', "saranjâm" },
{ 'سَرَانْجَام', "saranjâm" },
{ 'کُروز', "koruz" },
{ 'کُرَوز', "korawz" },
{ 'طَنین', "tanin" },
{ 'طَنَین', "tanayn" },
{ 'عَصاً', "’asan" },
{ 'خانه', "xâne" },
{ 'خانَه', "xâne" },
{ 'کُرِۀ شُمالی', "kore-ye šomâli" },
{ 'ضَمّه', "zamme" },
{ 'ضَمِّه', "zamme" },
{ 'وُدکا', "vodkâ" },
{ 'اَرمَنِستان', "armanestân" },
{ 'باکو', "bâku" },
}
self:iterate(examples, "do_test_translit")
end
return tests