Jump to content

Module:Convert to eastern arabic numerals/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Fredddie (talk | contribs) at 01:01, 28 December 2021 (fix). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests.
local p = require('Module:UnitTests')

-- Example unit test.
function p:test_convert()
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 0}}', '٠')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 1}}', '١')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 2}}', '٢')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 3}}', '٣')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 4}}', '٤')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 5}}', '٥')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 6}}', '٦')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 7}}', '٧')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 8}}', '٨')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 9}}', '٩')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 10}}', '١٠')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 3.1415}}', '٣,١٤١٥')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 73}}', '٧٣')
	self:preprocess_equals('{{#invoke:Convert to eastern arabic numerals | convert | 311}}', '٣١١')
end

return p