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 TartarTorte (talk | contribs) at 21:59, 27 December 2021 (Add some tests cases TDD). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- 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}}', '٣,١٤١٥')
end

return p