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.
16 of 16 tests failed. (refresh)
Text | Expected | Actual | Differs at | |
---|---|---|---|---|
![]() | سَرانجام | saranjâm | (nil) | N/A |
![]() | سَرانْجام | saranjâm | (nil) | N/A |
![]() | سَرَانْجَام | saranjâm | sarānjām/sarânjâm | 4 |
![]() | کُروز | koruz | kurōz/koruz | 2 |
![]() | کُرَوز | korawz | kurawz/korowz | 2 |
![]() | طَنین | tanin | tanēn/tanin | 4 |
![]() | طَنَین | tanayn | tanayn/taneyn | 7 |
![]() | عَصاً | ’asan | asan/asan | 1 |
![]() | خانه | xâne | (nil) | N/A |
![]() | خانَه | xâne | (nil) | N/A |
![]() | کُرِۀ شُمالی | kore-ye šomâli | (nil) | N/A |
![]() | ضَمّه | zamme | (nil) | N/A |
![]() | ضَمِّه | zamme | zammi/zamme | 5 |
![]() | وُدکا | vodkâ | (nil) | N/A |
![]() | اَرمَنِستان | armanestân | (nil) | N/A |
![]() | باکو | bâku | (nil) | N/A |
-- 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