diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-08 04:03:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-08 04:03:32 +0000 |
commit | fcf308e5fc6e0015a89ac57f6d40fec4bc3d99db (patch) | |
tree | cb5a947db7decdc303dda63630b4191741c2884d /test/ruby/test_time_tz.rb | |
parent | e94b5221c469082040243f155ec2c2e1825db8e7 (diff) |
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
Diffstat (limited to 'test/ruby/test_time_tz.rb')
-rw-r--r-- | test/ruby/test_time_tz.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |