Module:ISO 639/testcases
Appearance
This is the test cases page for the module Module:ISO 639. Results of the test cases. |
local p = require('Module:UnitTests')
local ISO_639 = require('Module:ISO_639')
function p:test_something()
local cases = {
{'en', 'English'},
{'ang', 'Old English'},
{'zh', 'Chinese'},
{'zh-hant', 'Traditional Chinese'},
{'zh-hans', 'Simplified Chinese'},
-- unrecognised
{'wtfbbq', nil},
-- actual language names are a fail too
{'English', nil},
};
for _, case in pairs(cases) do
local actual = ISO_639.language_name(case[1])
self:equals( case[1] .. '→' .. (case[2] or 'nil'),
actual, case[2] )
end
end
return p