summaryrefslogtreecommitdiff
path: root/test/ruby/test_time.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-07-24 15:21:08 -0700
committerJeremy Evans <code@jeremyevans.net>2020-07-28 12:53:37 -0700
commit520a734ad9c7348f4e4858ee24640f42c88fd389 (patch)
tree3c0c688a5f3e2955e9eb7e8d6a199a2595efcfbb /test/ruby/test_time.rb
parent1027520fec934490fa3995e91bf6f84c15629c6a (diff)
Fix Time#ceil when result should be the same as the receiver
Fixes [Bug #17025]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3362
Diffstat (limited to 'test/ruby/test_time.rb')
-rw-r--r--test/ruby/test_time.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 247bc34de7..0fc7dd78ab 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -1069,6 +1069,11 @@ class TestTime < Test::Unit::TestCase
t2 = (t+0.123456789).ceil(4)
assert_equal([59,59,23, 31,12,1999, 5,365,false,"UTC"], t2.to_a)
assert_equal(Rational(1235,10000), t2.subsec)
+
+ time = Time.utc(2016, 4, 23, 0, 0, 0.123456789r)
+ assert_equal(time, time.ceil(9))
+ assert_equal(time, time.ceil(10))
+ assert_equal(time, time.ceil(11))
end
def test_getlocal_dont_share_eigenclass