From fcf308e5fc6e0015a89ac57f6d40fec4bc3d99db Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 8 Oct 2018 04:03:32 +0000 Subject: Timezone at Time#+ and Time#- * time.c (time_add): support for Timezone. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_time_tz.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby/test_time_tz.rb') diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb index c3c272dca3..46bbc8433b 100644 --- a/test/ruby/test_time_tz.rb +++ b/test/ruby/test_time_tz.rb @@ -536,4 +536,10 @@ class TestTimeTZ::WithTZ < Test::Unit::TestCase t = Time.new(2018, 9, 1, 12, 0, 0, tz) assert_equal("+0900 #{abbr}", t.strftime("%z %Z")) end + + def test_plus_with_timezone + t = Time.new(2018, 9, 1, 12, 0, 0, tz) + 4000 + assert_equal([2018, 9, 1, 13, 6, 40, tz], [t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.zone]) + assert_equal(Time.utc(2018, 9, 1, 4, 6, 40), t) + end end -- cgit v1.2.3