-- Unit tests for . 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, '٠') self:preprocess_equals(m._convert, '١') self:preprocess_equals(m._convert, '٢') self:preprocess_equals(m._convert, '٣') self:preprocess_equals(m._convert, '٤') self:preprocess_equals(m._convert, '٥') self:preprocess_equals(m._convert, '٦') self:preprocess_equals(m._convert, '٧') self:preprocess_equals(m._convert, '٨') self:preprocess_equals(m._convert, '٩') self:preprocess_equals(m._convert, '١٠') self:preprocess_equals(m._convert, '٣,١٤١٥') self:preprocess_equals(m._convert, '٧٣') self:preprocess_equals(m._convert, '٣١١') self:preprocess_equals(m._convert, ) self:preprocess_equals(m._convert(nil), 'Error! Arguments provided are null')end
return p