Make beginless Range#size return nil if it ends with non-numeric

This commit is contained in:
fn ⌃ ⌥ 2022-01-06 13:19:50 -08:00 committed by Hiroshi SHIBATA
parent 4259d5b5ae
commit 3ef7b632a0

View File

@ -992,6 +992,7 @@ class TestRange < Test::Unit::TestCase
assert_equal Float::INFINITY, (...1).size
assert_equal Float::INFINITY, (...1.0).size
assert_nil ("a"...).size
assert_nil (..."z").size
end
def test_bsearch_typechecks_return_values