Content deleted Content added
test module sandbox |
try adding spellout tests using the #time parser function |
||
Line 36:
self:preprocess_equals('{{#invoke:TimeAgo/sandbox|main|{{CURRENTTIMESTAMP}}|min_magnitude=weeks}}', '0 weeks ago')
self:preprocess_equals('{{#invoke:TimeAgo/sandbox|main|15 September 2013|ago=}}', monthssincesep13 .. ' months')
self:preprocess_equals('{{#invoke:TimeAgo/sandbox|main|{{#time: r | -12 months -14 days}}|magnitude=months|spellout=yes}}', 'twelve months ago') -- #time always gives one month too few
self:preprocess_equals('{{#invoke:TimeAgo/sandbox|main|{{#time: r | -12 months -14 days}}|magnitude=months|spellout=y}}', 'twelve months ago')
self:preprocess_equals('{{#invoke:TimeAgo/sandbox|main|{{#time: r | -12 months -14 days}}|magnitude=months|spellout=y|spelloutmax=11}}', '12 months ago')
self:preprocess_equals('{{#invoke:TimeAgo/sandbox|main|{{#time: r | -12 months -14 days}}|magnitude=months|spellout=auto}}', '12 months ago')
self:preprocess_equals('{{#invoke:TimeAgo/sandbox|main|{{#time: r | -4 years -14 days}}|magnitude=years|spellout=auto}}', 'four years ago')
self:preprocess_equals('{{#invoke:TimeAgo/sandbox|main|July 1 2009|magnitude=weeks|spellout=yes}}', weekssincejul09 .. ' weeks ago') -- [[Module:NumberSpell]] can only spell numbers up to 100.
end
|