From 92304269bc91e973aca20af1ad4c0bfec786ad6a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 9 Aug 2022 09:22:53 +0900 Subject: Dump Date/DateTime as proleptic Gregorian date as well as Time Fix ruby/psych#572 --- test/psych/test_date_time.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/psych/test_date_time.rb b/test/psych/test_date_time.rb index 6f1e8b5..3379bd2 100644 --- a/test/psych/test_date_time.rb +++ b/test/psych/test_date_time.rb @@ -44,6 +44,26 @@ module Psych assert_match(/12:00:00-05:00/, cycled.last.to_s) end + def test_julian_date + d = Date.new(1582, 10, 4, Date::GREGORIAN) + assert_cycle d + end + + def test_proleptic_gregorian_date + d = Date.new(1582, 10, 14, Date::GREGORIAN) + assert_cycle d + end + + def test_julian_datetime + dt = DateTime.new(1582, 10, 4, 23, 58, 59, 0, Date::GREGORIAN) + assert_cycle dt + end + + def test_proleptic_gregorian_datetime + dt = DateTime.new(1582, 10, 14, 23, 58, 59, 0, Date::GREGORIAN) + assert_cycle dt + end + def test_invalid_date assert_cycle "2013-10-31T10:40:07-000000000000033" end -- cgit v1.2.1