diff options
author | John Hawthorn <john@hawthorn.email> | 2020-01-02 11:48:03 -0800 |
---|---|---|
committer | Aaron Patterson <tenderlove@github.com> | 2020-01-13 13:58:23 -0800 |
commit | 91601dcc6a608cb6f9a124959c738755091dfbd9 (patch) | |
tree | ef55399c8a55d7c223b5376f2b341a142474e26b /test/ruby | |
parent | 5f3189474c3ee3e11b6588acfbb026e119522092 (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2808
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_time.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |