Project

General

Profile

Bug #1165 ยป ruby-changes.patch

marcandre (Marc-Andre Lafortune), 02/17/2009 05:10 AM

View differences:

range.c (working copy)
{
if (range == obj)
return Qtrue;
if (!rb_obj_is_instance_of(obj, rb_obj_class(range)))
if (!rb_obj_is_kind_of(obj, rb_cRange))
return Qfalse;
if (!rb_equal(RANGE_BEG(range), RANGE_BEG(obj)))
......
{
if (range == obj)
return Qtrue;
if (!rb_obj_is_instance_of(obj, rb_obj_class(range)))
if (!rb_obj_is_kind_of(obj, rb_cRange))
return Qfalse;
if (!rb_eql(RANGE_BEG(range), RANGE_BEG(obj)))
test/ruby/test_range.rb (working copy)
assert(r != (1..2))
assert(r != (0..2))
assert(r != (0...1))
subclass = Class.new(Range)
assert(r == subclass.new(0,1))
end
def test_eql
......
assert(!r.eql?(1..2))
assert(!r.eql?(0..2))
assert(!r.eql?(0...1))
subclass = Class.new(Range)
assert(r.eql?(subclass.new(0,1)))
end
def test_hash
    (1-1/1)