--[=[  Unit tests for Module:Citation/CS1/Date validation.  Click talk page to run tests.  ]=]  local p = require('Module:UnitTests') --[[--------------------------< Y M X _ D A T E S >------------------------------------------------------------ ]]  function p:test_ymx_dates()														-- EDTF dates     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=1500-10-XX'},												-- invalid year 			{'date=5500-10-XX'},												-- invalid year 			{'date=1980-00-XX'},												-- invalid month 			{'date=1980-13-XX'},												-- invalid month 			{'date=2000-02-XX'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< Y M D _ D A T E S >------------------------------------------------------------ ]]  function p:test_ymd_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=1500-10-23'},												-- invalid year 			{'date=5500-10-23'},												-- invalid year 			{'date=1980-00-23'},												-- invalid month 			{'date=1980-13-23'},												-- invalid month 			{'date=1980-10-00'},												-- invalid day 			{'date=1980-10-55'},												-- invalid day 			{'date=1700-02-29'},												-- invalid date 			{'date=2000-02-29'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< M D Y _ D A T E S >------------------------------------------------------------ ]]  function p:test_mdy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=October 23, 96'},											-- invalid year 			{'date=October 23, 5500'},											-- invalid year 			{'date=Oktober 23, 1980'},											-- invalid month 			{'date=october 23, 1980'},											-- invalid month 			{'date=Sept 23, 1980'},												-- invalid month 			{'date=sep 23, 1980'},												-- invalid month 			{'date=October 00, 1980'},											-- invalid day 			{'date=October 55, 1980'},											-- invalid day 			{'date=February 29, 1700'},											-- invalid date 			{'date=October 23 1980'},											-- missing comma 			{'date=October, 23 1980'},											-- misplaced comma 			{'date=October 23,1980'},											-- missing space 			{'date=October23, 1980'},											-- missing space 			{'date=February 29, 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< M D D Y _ D A T E S >---------------------------------------------------------- ]]  function p:test_mddy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=October 23–25, 96'},											-- invalid year 			{'date=October 23–25, 5500'},										-- invalid year 			{'date=Oktober 23–25, 1980'},										-- invalid month 			{'date=october 23–25, 1980'},										-- invalid month 			{'date=Sept 23–25, 1980'},											-- invalid month 			{'date=sep 23–25, 1980'},											-- invalid month 			{'date=October 00–25, 1980'},										-- invalid day 			{'date=October 23–55, 1980'},										-- invalid day 			{'date=October 25–23, 1980'},										-- invalid day order 			{'date=October 23–23, 1980'},										-- invalid 2nd day 			{'date=February 25–29, 1700'},										-- invalid 2nd day 			{'date=October 23–25 1980'},										-- missing comma 			{'date=October, 23–25 1980'},										-- misplaced comma 			{'date=October 23–25,1980'},										-- missing space 			{'date=October23–25, 1980'},										-- missing space 			{'date=October 23 –25, 1980'},										-- extraneous space 			{'date=October 23– 25, 1980'},										-- extraneous space 			{'date=October 23-25, 1980'},										-- hyphen 			{'date=February 25–29, 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< D M Y _ D A T E S >------------------------------------------------------------ ]]  function p:test_dmy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=23 October 96'},												-- invalid year 			{'date=23 October 5500'},											-- invalid year 			{'date=23 Oktober 1980'},											-- invalid month 			{'date=23 october 1980'},											-- invalid month 			{'date=23 Sept 1980'},												-- invalid month 			{'date=23 sep 1980'},												-- invalid month 			{'date=00 October 1980'},											-- invalid day 			{'date=55 October 1980'},											-- invalid day 			{'date=29 February 1700'},											-- invalid date 			{'date=23, October 1980'},											-- extraneous comma 			{'date=23 October, 1980'},											-- extraneous comma 			{'date=23October 1980'},											-- missing space 			{'date=23 October1980'},											-- missing space 			{'date=29 February 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< D D M Y _ D A T E S >---------------------------------------------------------- ]]  function p:test_ddmy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=23–25 October 96'},											-- invalid year 			{'date=23–25 October 5500'},										-- invalid year 			{'date=23–25 Oktober 1980'},										-- invalid month 			{'date=23–25 october 1980'},										-- invalid month 			{'date=23–25 Sept 1980'},											-- invalid month 			{'date=23–25 sep 1980'},											-- invalid month 			{'date=00–25 October 1980'},										-- invalid day 			{'date=23–55 October 1980'},										-- invalid day 			{'date=25–23 October 1980'},										-- invalid day order 			{'date=23–23 February 1700'},										-- invalid 2nd day 			{'date=23–29 February 1700'},										-- invalid 2nd day 			{'date=23–25, October 1980'},										-- extraneous comma 			{'date=23–25 October, 1980'},										-- extraneous comma 			{'date=23–25 October1980'},											-- missing space 			{'date=23–25October 1980'},											-- missing space 			{'date=23 –25 October 1980'},										-- extraneous space 			{'date=23– 25 October 1980'},										-- extraneous space 			{'date=23-25 October 1980'},										-- hyphen 			{'date=23–25 February 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< M D M D Y _ D A T E S >-------------------------------------------------------- ]]  function p:test_mdmdy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=October 23 – November 25, 96'},								-- invalid year 			{'date=October 23 – November 25, 5500'},							-- invalid year 			{'date=Oktober 23 – November 25, 1980'},							-- invalid 1st month 			{'date=October 23 – Novembre 25, 1980'},							-- invalid 2nd month 			{'date=october 23 – November 25, 1980'},							-- invalid 1st month 			{'date=October 23 – november 25, 1980'},							-- invalid 2nd month 			{'date=Sept 23 – Oct 25, 1980'},									-- invalid 1st month 			{'date=Sep 23 – Okt 25, 1980'},										-- invalid 2nd month 			{'date=sep 23 – Oct 25, 1980'},										-- invalid 1st month 			{'date=Sep 23 – oct 25, 1980'},										-- invalid 2nd month 			{'date=October 25 – October 29, 1980'},								-- invalid 2nd month 			{'date=October 00 – November 25, 1980'},							-- invalid 1st day 			{'date=October 23 – November 55, 1980'},							-- invalid 2nd day 			{'date=October 23 – November 25 1980'},								-- missing comma 			{'date=October, 23 – November 25 1980'},							-- misplaced comma 			{'date=October 23, – November 25 1980'},							-- misplaced comma 			{'date=October 23 – November, 25 1980'},							-- misplaced comma 			{'date=October23 – November 25, 1980'},								-- missing space 			{'date=October 23– November 25, 1980'},								-- missing space 			{'date=October 23 –November 25, 1980'},								-- missing space 			{'date=October 23 – November25, 1980'},								-- missing space 			{'date=October 23 – November 25,1980'},								-- missing space 			{'date=Oct 23 – November 25, 1980'},								-- mixed style 			{'date=October 23 – Nov 25, 1980'},									-- mixed style 			{'date=October 23 – September 25, 1980'},							-- invalid month order 			{'date=Oct 23 – Sep 25, 1980'},										-- invalid month order 			{'date=October 23 – October 23, 1980'},								-- same dates 			{'date=October 23 - November 25, 1980'},							-- hyphen 			{'date=January 25 – February 29, 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< D M D M Y _ D A T E S >-------------------------------------------------------- ]]  function p:test_dmdmy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=23 October – 25 November 96'},								-- invalid year 			{'date=23 October – 25 November 5500'},								-- invalid year 			{'date=23 Oktober – 25 November 1980'},								-- invalid 1st month 			{'date=23 October – 25 Novembre 1980'},								-- invalid 2nd month 			{'date=23 october – 25 November 1980'},								-- invalid 1st month 			{'date=23 October – 25 november 1980'},								-- invalid 2nd month 			{'date=23 Sept – 25 Oct 1980'},										-- invalid 1st month 			{'date=23 Sep – 25 Okt 1980'},										-- invalid 2nd month 			{'date=23 sep – 25 Oct 1980'},										-- invalid 1st month 			{'date=23 Sep – 25 oct 1980'},										-- invalid 2nd month 			{'date=23 October – 29 October 1980'},								-- invalid 2nd month 			{'date=00 October – 25 November 1980'},								-- invalid 1st day 			{'date=23 October – 55 November 1980'},								-- invalid 2nd day 			{'date=23, October – 25 November 1980'},							-- extraneous comma 			{'date=23 October, – 25 November 1980'},							-- extraneous comma 			{'date=23 October – 25, November 1980'},							-- extraneous comma 			{'date=23 October – 25 November, 1980'},							-- extraneous comma 			{'date=23October – 25 November 1980'},								-- missing space 			{'date=23 October– 25 November 1980'},								-- missing space 			{'date=23 October –25 November 1980'},								-- missing space 			{'date=23 October – 25November 1980'},								-- missing space 			{'date=23 October – 25 November1980'},								-- missing space 			{'date=23 Oct – 25 November 1980'},									-- mixed style 			{'date=23 October – 25 Nov 1980'},									-- mixed style 			{'date=23 October – 25 September 1980'},							-- invalid month order 			{'date=23 October – 23 October 1980'},								-- same dates 			{'date=23 October - 25 November 1980'},								-- hyphen 			{'date=25 January – 29 February 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< M D Y M D Y _ D A T E S >------------------------------------------------------ ]]  function p:test_mdymdy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=October 23, 95 – November 25, 1996'},						-- invalid 1st year 			{'date=October 23, 1995 – November 25, 96'},						-- invalid 2nd year 			{'date=October 23, 5500 – November 25, 1996'},						-- invalid 1st year 			{'date=October 23, 1995 – November 25, 5500'},						-- invalid 1st year 			{'date=Oktober 23, 1979 – November 25, 1980'},						-- invalid 1st month 			{'date=October 23, 1979 – Novembre 25, 1980'},						-- invalid 2nd month 			{'date=october 23, 1979 – November 25, 1980'},						-- invalid 1st month 			{'date=October 23, 1979 – november 25, 1980'},						-- invalid 2nd month 			{'date=Sept 23, 1979 – Oct 25, 1980'},								-- invalid 1st month 			{'date=Sep 23, 1979 – Okt 25, 1980'},								-- invalid 2nd month 			{'date=sep 23, 1979 – Oct 25, 1980'},								-- invalid 1st month 			{'date=October 00, 1979 – November 25, 1980'},						-- invalid 1st day 			{'date=October 23, 1979 – November 55, 1980'},						-- invalid 2nd day 			{'date=October 23 1979 – November 25, 1980'},						-- missing comma 			{'date=October 23, 1979 – November 25 1980'},						-- missing comma 			{'date=October, 23 1979 – November 25, 1980'},						-- misplaced comma 			{'date=October 23 1979, – November 25, 1980'},						-- misplaced comma 			{'date=October 23, 1979 – November, 25 1980'},						-- misplaced comma 			{'date=October23, 1979 – November 25, 1980'},						-- missing space 			{'date=October 23,1979 – November 25, 1980'},						-- missing space 			{'date=October 23, 1979– November 25, 1980'},						-- missing space 			{'date=October 23, 1979 –November25, 1980'},						-- missing space 			{'date=October 23, 1979 – November25, 1980'},						-- missing space 			{'date=October 23, 1979 – November 25,1980'},						-- missing space 			{'date=Oct 23, 1979 – November 25, 1980'},							-- mixed style 			{'date=October 23, 1979 – Nov 25, 1980'},							-- mixed style 			{'date=September 25, 1980 – October 23, 1979'},						-- invalid year order 			{'date=October 23, 1979 – October 23, 1979'},						-- same dates 			{'date=October 23, 1979 - November 25, 1980'},						-- hyphen 			{'date=January 25, 1979 – February 29, 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< D M Y D M Y _ D A T E S >------------------------------------------------------ ]]  function p:test_dmydmy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=23 October 95 – 25 November 1996'},							-- invalid 1st year 			{'date=23 October 1995 – 25 November 96'},							-- invalid 2nd year 			{'date=23 October 5500 – 25 November 1996'},						-- invalid 1st year 			{'date=23 October 1995 – 25 November 5500'},						-- invalid 2nd year 			{'date=23 Oktober 1979 – 25 November 1980'},						-- invalid 1st month 			{'date=23 October 1979 – 25 Novembre 1980'},						-- invalid 2nd month 			{'date=23 october 1979 – 25 November 1980'},						-- invalid 1st month 			{'date=23 October 1979 – 25 november 1980'},						-- invalid 2nd month 			{'date=23 Sept 1979 – 25 Oct 1980'},								-- invalid 1st month 			{'date=23 Sep 1979 – 25 Okt 1980'},									-- invalid 2nd month 			{'date=23 sep 1979 – 25 Oct 1980'},									-- invalid 1st month 			{'date=00 October 1979 – 25 November 1980'},						-- invalid 1st day 			{'date=23 October 1979 – 55 November 1980'},						-- invalid 2nd day 			{'date=23, October 1979 – 25 November 1980'},						-- extraneous comma 			{'date=23 October, 1979 – 25 November 1980'},						-- extraneous comma 			{'date=23 October 1979, – 25 November 1980'},						-- extraneous comma 			{'date=23 October 1979 – 25, November 1980'},						-- extraneous comma 			{'date=23 October 1979 – 25 November, 1980'},						-- extraneous comma 			{'date=23October 1979 – 25 November 1980'},							-- missing space 			{'date=23 October1979 – 25 November 1980'},							-- missing space 			{'date=23 October 1979– 25 November 1980'},							-- missing space 			{'date=23 October 1979 –25 November 1980'},							-- missing space 			{'date=23 October 1979 – 25November 1980'},							-- missing space 			{'date=23 October 1979 – 25 November1980'},							-- missing space 			{'date=23 Oct 1979 – 25 November 1980'},							-- mixed month style 			{'date=23 October 1979 – 25 Nov 1980'},								-- mixed month style 			{'date=23 October 1979 – November 25, 1980'},						-- mixed date style 			{'date=25 September 1980 – 23 October 1979'},						-- invalid year order 			{'date=23 October 1979 – 23 October 1979'},							-- same dates 			{'date=23 October 1979 - 25 November 1980'},						-- hyphen 			{'date=25 January 1979 – 29 February 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< M Y _ D A T E S >-------------------------------------------------------------- ]]  function p:test_my_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=October 96'},												-- invalid year 			{'date=October 5500'},												-- invalid year 			{'date=Oktober 1980'},												-- invalid month 			{'date=october 1980'},												-- invalid month 			{'date=Sept 1980'},													-- invalid month 			{'date=sep 1980'},													-- invalid month 			{'date=October, 1980'},												-- extraneous comma 			{'date=October1980'},												-- missing space 			{'date=February 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  --[[--------------------------< S Y _ D A T E S >-------------------------------------------------------------- ]]  function p:test_sy_dates()     self:preprocess_equals_preprocess_many(     	'', '', 		{ 			{'date=Spring 96'},													-- invalid year 			{'date=Summer 5500'},												-- invalid year 			{'date=spring 1980'},												-- invalid season 			{'date=summer 1980'},												-- invalid season 			{'date=autumn 1980'},												-- invalid season 			{'date=fall 1980'},													-- invalid season 			{'date=Winter, 1980'},												-- extraneous comma 			{'date=Spring1980'},												-- missing space 			{'date=Spring 2000'}, 			{'date=Summer 2000'}, 			{'date=Autumn 2000'}, 			{'date=Fall 2000'}, 			{'date=Winter 2000'}, 		}, 		{nowiki=false, templatestyles=true} 	) end  return p