diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-15 13:21:10 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-15 13:21:10 +0000 |
commit | 795b03c71c7949c0c260139d6f8a3e289826fdca (patch) | |
tree | 4b077adcbb200de927acac356a919db107d13de2 /test | |
parent | 3360a65ba7fc04f12fd470aaa6c91a0b94013abd (diff) | |
download | ruby-795b03c71c7949c0c260139d6f8a3e289826fdca.tar.gz |
* time.c (time_add): propagate fixed time offset.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_time.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 73afed3902..c583b4e873 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -27,6 +27,16 @@ class TestTime < Test::Unit::TestCase assert_equal(Time.utc(2000, 3, 21, 3, 30) + (-3 * 3600), Time.utc(2000, 3, 21, 0, 30)) assert_equal(0, (Time.at(1.1) + 0.9).usec) + + assert((Time.utc(2000, 4, 1) + 24).utc?) + assert(!(Time.local(2000, 4, 1) + 24).utc?) + + t = Time.new(2000, 4, 1, 0, 0, 0, "+01:00") + 24 + assert(!t.utc?) + assert_equal(3600, t.utc_offset) + t = Time.new(2000, 4, 1, 0, 0, 0, "+02:00") + 24 + assert(!t.utc?) + assert_equal(7200, t.utc_offset) end def test_time_subt() |