diff options
author | odaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-16 23:20:14 +0000 |
---|---|---|
committer | odaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-16 23:20:14 +0000 |
commit | 82b884032090aec113bb57dee40cec0f69441778 (patch) | |
tree | c2d0469e4db4aadf4ead8924855b28b148cff758 | |
parent | c9165d06441fcb126d1d36a9b2fb123d404d2001 (diff) |
* test/-ext-/time/test_new.rb (test_timespec_new): Time#gmtoff values
are the same only when both or neither of the Time objects are in
summer time (daylight-saving time).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | test/-ext-/time/test_new.rb | 4 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Thu Mar 17 08:13:43 2016 Rei Odaira <Rei.Odaira@gmail.com> + + * test/-ext-/time/test_new.rb (test_timespec_new): Time#gmtoff values + are the same only when both or neither of the Time objects are in + summer time (daylight-saving time). + Thu Mar 17 07:17:36 2016 Eric Hodel <drbrain@segment7.net> * marshal.c (r_object0): raise ArgumentError when linking to undefined diff --git a/test/-ext-/time/test_new.rb b/test/-ext-/time/test_new.rb index 699201fda5..67f5328819 100644 --- a/test/-ext-/time/test_new.rb +++ b/test/-ext-/time/test_new.rb @@ -23,7 +23,9 @@ class Bug::Time::Test_New < Test::Unit::TestCase assert_equal(false, Bug::Time.timespec_new(1447087832, 476451125, 0).utc?) assert_equal(true, Bug::Time.timespec_new(1447087832, 476451125, 0x7ffffffe).utc?) assert_equal(false, Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).utc?) - assert_equal(Time.now.gmtoff, Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff) + if Time.now.isdst == Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).isdst + assert_equal(Time.now.gmtoff, Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff) + end assert_time_equal(Time.at(1447087832, 476451.125).localtime(86399), Bug::Time.timespec_new(1447087832, 476451125, 86399)) assert_time_equal(Time.at(1447087832, 476451.125).localtime(-86399), |