aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-13 19:04:17 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-13 19:04:17 +0000
commitd5a96ece8548020e5c27059f924e11e9d4c2f90e (patch)
tree53e3483d04b76812943fa2d626789fba28c1b6e6 /test
parent17f04eb438f8390398aff3a9347c7c0298794b39 (diff)
downloadruby-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.rb5
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 }