diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-03 15:37:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-03 15:37:45 +0000 |
commit | b3085ba508b9582ff279c2ddf59a44885e22c074 (patch) | |
tree | c9ddb23b7ef2ed69c30aed80a916540c0939de69 /test/ruby | |
parent | 572c266e055e517896accfee55672fa1352a36db (diff) | |
download | ruby-b3085ba508b9582ff279c2ddf59a44885e22c074.tar.gz |
* time.c (time_mdump, time_mload): dump/load utc_offset.
[ruby-dev:40063]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_time.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index d5dd86765f..73afed3902 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -210,6 +210,20 @@ class TestTime < Test::Unit::TestCase assert_marshal_roundtrip(Marshal.load(Marshal.dump(t))) end + def test_marshal_timezone + bug = '[ruby-dev:40063]' + + t1 = Time.gm(2000) + m = Marshal.dump(t1.getlocal("-02:00")) + t2 = Marshal.load(m) + assert_equal(t1, t2) + assert_equal(-7200, t2.utc_offset, bug) + m = Marshal.dump(t1.getlocal("+08:15")) + t2 = Marshal.load(m) + assert_equal(t1, t2) + assert_equal(29700, t2.utc_offset, bug) + end + # Sat Jan 01 00:00:00 UTC 2000 T2000 = Time.at(946684800).gmtime |