Module:Sandbox/Hellknowz/Test/testcases: Difference between revisions

Content deleted Content added
add dash to span ranges
add
 
(10 intermediate revisions by the same user not shown)
Line 17:
{ 'June 2013', '2013-06' },
{ '2013 June', '2013-06' },
{ '2013, June', '2013-06' },
{ 'August 2013', '2013-08' },
{ 'August, 2013', '2013-08' },
{ 'May 2013', '2013-05' },
{ 'Jan 2013', '2013-01' },
{ 'Dec 2013', '2013-12' },
{ 'Dec. 2013', '2013-12' },
{ 'December, 2013', '2013-12' },
{ 'June 1013', 'Invalid date/time' },
{ 'June 2113', '2113-06' },
Line 44 ⟶ 48:
{ '12 Blobember 2013', 'Unrecognized pattern' },
{ '12 Dec 2013', '2013-12-12' },
{ '12 Dec. 2013', '2013-12-12' },
{ '12 June 96', 'Unrecognized pattern' },
{ '3 May, 2013', '2013-05-03' },
{ '3rd May 2013', '2013-05-03' },
{ '3rd May, 2013', '2013-05-03' },
 
--Mdy
Line 50 ⟶ 58:
{ 'August 27, 2013', '2013-08-27' },
{ 'November 30, 2013', '2013-11-30' },
{ 'Nov. 30, 2013', '2013-11-30' },
{ 'June 32, 2013', 'Invalid date/time' },
{ 'June 31, 2013', 'Invalid date/time' },
Line 62 ⟶ 71:
{ 'Blobember 12, 2013', 'Unrecognized pattern' },
{ 'June 12, 96', 'Unrecognized pattern' },
{ 'May 3 2013', '2013-05-03' },
{ 'May 3, 2013', '2013-05-03' },
{ 'May 3rd 2013', '2013-05-03' },
{ 'May 3rd, 2013', '2013-05-03' },
 
{ '2013 May 3', '2013-05-03' },
{ '2013, May 3', '2013-05-03' },
{ '2013 3 May', '2013-05-03' },
{ '2013, 3 May', '2013-05-03' },
 
--ymd
Line 79 ⟶ 97:
{ '2013-14-12', 'Invalid date/time' },
{ '2013-00-12', 'Invalid date/time' },
{ '20132003-0511', '2013-05Unrecognized pattern' }, -- for now (ambiguous case)
{ '2003-13', 'Unrecognized pattern' }, -- for now
 
{ '2013-05', 'Unrecognized pattern' }, -- for now
{ '2013-13', 'Unrecognized pattern' }, -- for now
{ '1999-11', 'Unrecognized pattern' }, -- for now
{ '1906-08', 'Unrecognized pattern' }, -- for now
-- hms
{ '10:38:27', '10:38:27'},
Line 204 ⟶ 226:
-- hp ymd
{ '10 pm, 1973-05-01', '1973-05-01 22'},
 
{ '10:38:, May 1, 1973', 'Unrecognized pattern'},
{ '10:, May 1, 1973', 'Unrecognized pattern'},
{ '10, May 1, 1973', 'Unrecognized pattern'},
 
-- invalid
Line 226 ⟶ 252:
{ 'May 2013 - February 2014', '2013-05; 2014-02' },
{ '2013 - 2014', '2013; 2014' },
 
{ 'May 3 2013 - February 12 2014', '2013-05-03; 2014-02-12' },
{ 'May 3 - October 12 2013', '2013-05-03; 2013-10-12' },
{ 'May 3 - 12 2013', '2013-05-03; 2013-05-12' },
 
{ '3rd May 2013 - 12th February 2014', '2013-05-03; 2014-02-12' },
{ 'May 3rd, 2013 - February 12th, 2014', '2013-05-03; 2014-02-12' },
{ '3rd May - 12th October 2013', '2013-05-03; 2013-10-12' },
{ 'May 3rd - October 12th, 2013', '2013-05-03; 2013-10-12' },
{ '3rd - 12th May 2013', '2013-05-03; 2013-05-12' },
{ 'May 3rd - 12th, 2013', '2013-05-03; 2013-05-12' },
 
-- variations in dates
Line 288 ⟶ 325:
{ ' ', 'Empty input' },
 
--{ '{{Start date|2012|12|10}}', 'Has metadata template' },
--[[
--{ '{{Enddate|2013|12|10}}', 'Has metadata template' },
 
--[[
{ '3 May 2013 - 5 April 2014', '2013-05-03; 2014-04-05' },
{ '3 May 2013 - April 2014', '' },
Line 303 ⟶ 343:
function p:test_emitMetadata() -- Must begin with 'test'
 
self:preprocess_equals_many('{{#invoke:Sandbox/Hellknowz/Test|emitMetadata|<nowiki>', '</nowiki>|dtstart=yes|dtend=yes|noTrackingCat=yes}}', {
-- different styles
Line 320 ⟶ 360:
{ 'May 2013 – February 2014', '<span style="display:none">&#160;(<span class="dtstart">2013-05</span> - <span class="dtend">2014-02</span>)</span>' },
{ '2013 – 2014', '<span style="display:none">&#160;(<span class="dtstart">2013</span> - <span class="dtend">2014</span>)</span>' },
 
{ '3 May 2013 <!--Hello-->', '<span style="display:none">&#160;(<span class="dtstart">2013-05-03</span>)</span>' },
{ '3 May 2013 {{Flag icon|USA}}', '<span style="display:none">&#160;(<span class="dtstart">2013-05-03</span>)</span>' },
{ '3 May 2013<ref>Excellent job</ref>', '<span style="display:none">&#160;(<span class="dtstart">2013-05-03</span>)</span>' },
{ '<!--Don`t change to 4-->3 May 2013', '<span style="display:none">&#160;(<span class="dtstart">2013-05-03</span>)</span>' },
 
}, { nowiki = true } )
 
Line 332 ⟶ 377:
-- references stripping
{ '3 May 2013', '3 May 2013' },
{ '3 May 2013 ', '3 May 2013' },
{ ' 3 May 2013', '3 May 2013' },
{ ' 3 May 2013 ', '3 May 2013' },
{ '3 May 2013<ref>Well, hello there!</ref>', '3 May 2013' },
{ '3 May 2013 <ref>Well, hello there!</ref>', '3 May 2013' },
{ '3 May 2013<ref name="hello">Well, hello there!</ref>', '3 May 2013' },
{ '3 May 2013</ref>Broken', '3 May 2013</ref>Broken' }, -- opening ref causes markup errors
{ '3 May 2013<ref></ref>', '3 May 2013' },
{ '3 May 2013<ref>Well, hello there!</ref><ref>Well, hello!</ref>', '3 May 2013' },
{ '3 May 2013<ref>Well, hello there!</ref><ref>Well, hello!</ref><ref>Well well well</ref>', '3 May 2013' },
{ '3 May 2013<ref name="hello">Well,</ref><ref name="hello">..hello!</ref>', '3 May 2013' },
{ '3 May 2013<ref></ref><ref></ref>', '3 May 2013' },
{ '3 May 2013<ref name="junky"/>', '3 May 2013' },
{ '3 May 2013<ref name="junky"/><ref name="junky"/>', '3 May 2013' },
{ '3 May 2013<ref name="junky"/><ref name="junky"/><ref name="junky"/>', '3 May 2013' },
{ '3 May 2013 <ref name="junky"/>', '3 May 2013' },
{ '3 May 2013<!--don\'t add extra dates-->', '3 May 2013' },
{ '3 May 2013 <!---->', '3 May 2013' },
{ '<!--Per MOS somethng do something-->3 May 2013', '3 May 2013' },
{ '<!----> 3 May 2013', '3 May 2013' },
{ '{{Flag icon|USA}} 3 May 2013', '3 May 2013' },
{ '{{Flagicon|UK}} 3 May 2013', '3 May 2013' },
{ '{{Flagicon|UK}} {{Flag icon|USA}} 3 May 2013', '3 May 2013' },
{ '3 May 2013{{Flagicon|UK}}', '3 May 2013' },
{ '3 May 2013 {{Flagicon|UK}} {{Flag icon|USA}} ', '3 May 2013' },
{ '{{Nowrap|3 May 2013}}', '3 May 2013' },
{ '{{no break | 3 May 2013 }}', '3 May 2013' },
}