mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* time.c (search_time_t): limit guess range by mktime if it is
availabe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7c34ed846f
commit
7bb7e17675
3 changed files with 24 additions and 0 deletions
|
@ -23,4 +23,14 @@ class TestTime < Test::Unit::TestCase
|
|||
assert_equal(Time.utc(2000, 3, 21, 0, 30) \
|
||||
-Time.utc(2000, 3, 21, 3, 30), -3*3600)
|
||||
end
|
||||
|
||||
def test_negative
|
||||
begin
|
||||
Time.at(-1)
|
||||
rescue ArgumentError
|
||||
return
|
||||
end
|
||||
assert_equal(-1, Time.utc(1969, 12, 31, 23, 59, 59).tv_sec)
|
||||
assert_equal(-2, Time.utc(1969, 12, 31, 23, 59, 58).tv_sec)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue