diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2018-09-27 18:17:28 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-19 15:26:53 +0900 |
commit | e690df1f1ef4f791295448f9192d6e027400ee72 (patch) | |
tree | bd0ab0a070f7e57744761a74d4f8eda35fa01fc8 /test | |
parent | 8797f48373dcfa3ff8e748667732dea8aea4347e (diff) |
Marshal distant past/future
[Feature #15160]
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_time.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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)) |