Module:Time ago/testcases
Appearance
![]() | This is the test cases page for the module Module:Time ago. Results of the test cases. |
-- Unit tests for [[Module:TimeAgo]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_timeAgo()
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|1 January 2012}}', '{{Time ago|1 January 2012}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|{{CURRENTTIMESTAMP}}}}', '{{Time ago|{{CURRENTTIMESTAMP}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|1 January 2012|purge=yes}}', '{{Time ago|1 January 2012|purge=yes}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|{{CURRENTTIMESTAMP}}}}|purge=yes}}', '{{Time ago|{{CURRENTTIMESTAMP}}|purge=yes}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|July 1 2009}}', '{{Time ago|July 1 2009}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|July 1 2009|magnitude=minutes}}', '{{Time ago|July 1 2009|magnitude=minutes}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|July 1 2009|magnitude=days}}', '{{Time ago|July 1 2009|magnitude=days}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|July 1 2009|magnitude=weeks}}', '{{Time ago|July 1 2009|magnitude=minutes}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|July 1 2009|magnitude=months}}', '{{Time ago|July 1 2009|magnitude=minutes}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|July 1 2049|magnitude=months}}', '{{Time ago|July 1 2049|magnitude=months}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|Julio 1}}', '{{Time ago|Julio 1}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|July 1 2009|magnitude=fruits}}', '{{Time ago|July 1 2009|July 1 2009|magnitude=fruits}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo}}', '{{Time ago}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|July 1 2009|magnitude=HoUrS}}', '{{Time ago|July 1 2009|magnitude=HoUrS}}')
self:preprocess_equals('{{#invoke:TimeAgo|timeAgo|4 August 2057}}', '{{time ago|4 August 2057}}')
end
return p