From 6445aab4724529f511c5d2908b452e8145560f14 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 19 Nov 2011 10:47:03 +0000 Subject: * time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too. patch by Tomoyuki Chikanaga. [ruby-dev:44827] [Bug #5586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_time.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 0f54b65cc7..cf7aad38a2 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -278,6 +278,13 @@ class TestTime < Test::Unit::TestCase assert_equal(29700, t2.utc_offset, bug) end + def test_marshal_to_s + t1 = Time.new(2011,11,8, 0,42,25, 9*3600) + t2 = Time.at(Marshal.load(Marshal.dump(t1))) + assert_equal("2011-11-08 00:42:25 +0900", t2.to_s, + "[ruby-dev:44827] [Bug #5586]") + end + # Sat Jan 01 00:00:00 UTC 2000 T2000 = Time.at(946684800).gmtime -- cgit v1.2.3