1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* time.c (time_minus): fix Time.at(2**60+1) - Time.at(2**60).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-11-18 09:30:17 +00:00
parent 1e3ca9807b
commit 3184ac2dfe
3 changed files with 18 additions and 2 deletions

View file

@ -71,4 +71,14 @@ class TestTime < Test::Unit::TestCase
assert_equal(Time.at(0x7fffffff), Time.at(-0x80000000) - (-0xffffffff))
end
end
def test_big_minus
begin
bigtime0 = Time.at(2**60)
bigtime1 = Time.at(2**60+1)
rescue RangeError
return
end
assert_equal(1.0, bigtime1 - bigtime0)
end
end