Module:Convert to eastern arabic numerals/testcases

-- Unit tests for Module:. Click talk page to run tests. local p = require('Module:UnitTests') local m = require('Module:Convert to eastern arabic numerals')

-- Example unit test. function p:test_convert self:preprocess_equals('', '٠') self:preprocess_equals('', '١') self:preprocess_equals('', '٢') self:preprocess_equals('', '٣') self:preprocess_equals('', '٤') self:preprocess_equals('', '٥') self:preprocess_equals('', '٦') self:preprocess_equals('', '٧') self:preprocess_equals('', '٨') self:preprocess_equals('', '٩') self:preprocess_equals('', '١٠') self:preprocess_equals('', '٣,١٤١٥') self:preprocess_equals('', '٧٣') self:preprocess_equals('', '٣١١') self:preprocess_equals(, ) end

function p:test__convert self:preprocess_equals(m._convert({0}), '٠') self:preprocess_equals(m._convert({1}), '١') self:preprocess_equals(m._convert({2}), '٢') self:preprocess_equals(m._convert({3}), '٣') self:preprocess_equals(m._convert({4}), '٤') self:preprocess_equals(m._convert({5}), '٥') self:preprocess_equals(m._convert({6}), '٦') self:preprocess_equals(m._convert({7}), '٧') self:preprocess_equals(m._convert({8}), '٨') self:preprocess_equals(m._convert({9}), '٩') self:preprocess_equals(m._convert({10}), '١٠') self:preprocess_equals(m._convert({3.1415}), '٣,١٤١٥') self:preprocess_equals(m._convert({73}), '٧٣') self:preprocess_equals(m._convert({311}), '٣١١') self:preprocess_equals(m._convert({}), '') self:preprocess_equals(m._convert(nil), 'Error! Arguments provided are null') end

return p