diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-04 04:23:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-04 04:23:06 +0000 |
commit | 95f396fdd8c6bdf3304a934e4a6d624867fd0198 (patch) | |
tree | 2d2f2cc88e48b0c54743d55e260585a6e7e53f89 /test | |
parent | 76bac5b37c49a9510e5512a9f0d832ccedbbf618 (diff) | |
download | ruby-95f396fdd8c6bdf3304a934e4a6d624867fd0198.tar.gz |
time.c: preserve marshalled timezone
* time.c (time_add): preserve timezone name restored by Marshal.
[ruby-core:81892] [Bug #13710]
* time.c (time_mload): reset localtime if having timezone.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_time.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 41d4b03553..c92aafc149 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -308,7 +308,9 @@ class TestTime < Test::Unit::TestCase in_timezone('JST-9') do t = Time.local(2013, 2, 24) assert_equal('JST', Time.local(2013, 2, 24).zone) - assert_equal('JST', Marshal.load(Marshal.dump(t)).zone) + t = Marshal.load(Marshal.dump(t)) + assert_equal('JST', t.zone) + assert_equal('JST', (t+1).zone, '[ruby-core:81892] [Bug #13710]') end end |