summaryrefslogtreecommitdiff
path: root/test/ruby/test_time.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_time.rb')
-rw-r--r--test/ruby/test_time.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 02ebc6ac38..188ec0da04 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -311,6 +311,21 @@ class TestTime < Test::Unit::TestCase
end
end
+ def test_marshal_zone_gc
+ assert_separately(%w(--disable-gems), <<-'end;', timeout: 30)
+ ENV["TZ"] = "JST-9"
+ s = Marshal.dump(Time.now)
+ t = Marshal.load(s)
+ n = 0
+ done = 100000
+ while t.zone.dup == "JST" && n < done
+ n += 1
+ end
+ assert_equal done, n, "Bug #9652"
+ assert_equal "JST", t.zone, "Bug #9652"
+ end;
+ 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)))