From e690df1f1ef4f791295448f9192d6e027400ee72 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 27 Sep 2018 18:17:28 +0900 Subject: Marshal distant past/future [Feature #15160] --- test/ruby/test_time.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 4c0a104976..7269bdc3ff 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -375,6 +375,16 @@ class TestTime < Test::Unit::TestCase end end + def test_marshal_distant_past + assert_marshal_roundtrip(Time.utc(1890, 1, 1)) + assert_marshal_roundtrip(Time.utc(-4.5e9, 1, 1)) + end + + def test_marshal_distant_future + assert_marshal_roundtrip(Time.utc(30000, 1, 1)) + assert_marshal_roundtrip(Time.utc(5.67e9, 4, 8)) + end + def test_at3 t2000 = get_t2000 assert_equal(t2000, Time.at(t2000)) -- cgit v1.2.3