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 | a75c56eaf0cfa5b8a016329a2ef1f350ab7de779 (patch) | |
tree | cb5a947db7decdc303dda63630b4191741c2884d /test | |
parent | e5d9e98fdc6a4712d7c5642b5cc9436aab5af676 (diff) | |
download | ruby-a75c56eaf0cfa5b8a016329a2ef1f350ab7de779.tar.gz |
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')
-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 |