From 91601dcc6a608cb6f9a124959c738755091dfbd9 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 2 Jan 2020 11:48:03 -0800 Subject: Simplify obj2ubits checks If this value is less than zero, then the mask check is guaranteed to fail as well, so we might as well rely on that. --- test/ruby/test_time.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 35e3172fb1..3cf7f2b145 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -431,6 +431,10 @@ class TestTime < Test::Unit::TestCase assert_equal(-4427700000, Time.utc(-4427700000,12,1).year) assert_equal(-2**30+10, Time.utc(-2**30+10,1,1).year) + + assert_raise(ArgumentError) { Time.gm(2000, 1, -1) } + assert_raise(ArgumentError) { Time.gm(2000, 1, 2**30 + 1) } + assert_raise(ArgumentError) { Time.gm(2000, 1, -2**30 + 1) } end def test_time_interval -- cgit v1.2.3