-- Unit tests for [[Module:pnb-convert/sandbox]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local ur_convert = require('Module:pnb-convert/sandbox')
local m_links = require('Module:links')
local ur = require('Module:languages').getByCode('ur')
local function link(term)
return m_links.full_link{term = term, lang = ur}
end
function tests:do_test_convert(Urdu, Guru, xlit)
self:equals(link(Urdu), ur_convert.tr(Urdu, 'ur', 'ur-Arab'), Guru)
end
function tests:test_convert_urdu()
local examples = {
{"جُھوٹھ", "ਝੂਠ"},
{"گَھر", "ਘਰ"},
{"میز", "ਮੇਜ਼"},
{"مَوسَم", "ਮੌਸਮ"},
{"پَینْدا", "ਪੈਂਦਾ"},
{"تُہاڈا", "ਤੁਹਾਡਾ"},
{"لان٘گھا", "ਲਾਂਘਾ"},
{"جَھلّا", "ਝੱਲਾ"},
{"نِچّھ", "ਨਿੱਛ"},
{"لِتَّر", "ਲਿੱਤਰ"},
{"چِھتَّر", "ਛਿੱਤਰ"},
{"رَوࣇا", "ਰੌਲ਼ਾ"},
{"تْراہ", "ਤ੍ਰਾਹ"},
}
self:iterate(examples, "do_test_convert")
end
return tests