* 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
This commit is contained in:
akr 2010-01-13 19:04:17 +00:00
parent 17f04eb438
commit d5a96ece85
3 changed files with 44 additions and 18 deletions

View file

@ -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 }