diff options
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/time/test_new.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/-ext-/time/test_new.rb b/test/-ext-/time/test_new.rb index 67f5328819..8283bd6828 100644 --- a/test/-ext-/time/test_new.rb +++ b/test/-ext-/time/test_new.rb @@ -23,9 +23,11 @@ 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?) - 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 + # Cannot compare Time.now.gmtoff with + # Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff, because + # it depends on whether the current time is in summer time (daylight-saving time) or not. + t = Time.now + assert_equal(t.gmtoff, Bug::Time.timespec_new(t.tv_sec, t.tv_nsec, 0x7fffffff).gmtoff) 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), |