diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-13 19:04:17 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-13 19:04:17 +0000 |
commit | d5a96ece8548020e5c27059f924e11e9d4c2f90e (patch) | |
tree | 53e3483d04b76812943fa2d626789fba28c1b6e6 /test | |
parent | 17f04eb438f8390398aff3a9347c7c0298794b39 (diff) | |
download | ruby-d5a96ece8548020e5c27059f924e11e9d4c2f90e.tar.gz |
* time.c (time_mdump): use nano_num and nano_den instead of subnano to
avoid Rational class in marshaled data which prevent unmarshal by
Ruby 1.8.
(time_mload): use nano_num and nano_den.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_time.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index cf2d51c925..e6d5d31d80 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -191,6 +191,11 @@ class TestTime < Test::Unit::TestCase assert_marshal_roundtrip(Time.at(0, 0.120)) end + def test_marshal_rational + assert_marshal_roundtrip(Time.at(0, Rational(1,3))) + assert_not_match(/Rational/, Marshal.dump(Time.at(0, Rational(1,3)))) + end + def test_marshal_ivar t = Time.at(123456789, 987654.321) t.instance_eval { @var = 135 } |