Project

General

Profile

Bug #18983 » 6378.patch

thiagofm (Thiago Massa), 09/14/2022 09:58 PM

View differences:

range.c
}
}
else if (NIL_P(b)) {
if (!rb_obj_is_kind_of(e, rb_cNumeric)) {
return Qnil;
}
return DBL2NUM(HUGE_VAL);
}
test/ruby/test_range.rb
assert_equal 6, (1...6.3).size
assert_equal 5, (1.1...6).size
assert_equal 42, (1..42).each.size
assert_nil ("a"..."z").size
assert_equal Float::INFINITY, (1...).size
assert_equal Float::INFINITY, (1.0...).size
assert_equal Float::INFINITY, (...1).size
assert_equal Float::INFINITY, (...1.0).size
assert_nil ("a"..."z").size
assert_nil ("a"...).size
assert_nil (..."a").size
assert_nil (nil...nil).size
end
def test_bsearch_typechecks_return_values
(2-2/2)