Project

General

Profile

Bug #1165 ยป ruby-changes.patch

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

View differences:

range.c (working copy)
125 125
{
126 126
    if (range == obj)
127 127
	return Qtrue;
128
    if (!rb_obj_is_instance_of(obj, rb_obj_class(range)))
128
    if (!rb_obj_is_kind_of(obj, rb_cRange))
129 129
	return Qfalse;
130 130

  
131 131
    if (!rb_equal(RANGE_BEG(range), RANGE_BEG(obj)))
......
187 187
{
188 188
    if (range == obj)
189 189
	return Qtrue;
190
    if (!rb_obj_is_instance_of(obj, rb_obj_class(range)))
190
    if (!rb_obj_is_kind_of(obj, rb_cRange))
191 191
	return Qfalse;
192 192

  
193 193
    if (!rb_eql(RANGE_BEG(range), RANGE_BEG(obj)))
test/ruby/test_range.rb (working copy)
89 89
    assert(r != (1..2))
90 90
    assert(r != (0..2))
91 91
    assert(r != (0...1))
92
    subclass = Class.new(Range)
93
    assert(r == subclass.new(0,1))
92 94
  end
93 95

  
94 96
  def test_eql
......
99 101
    assert(!r.eql?(1..2))
100 102
    assert(!r.eql?(0..2))
101 103
    assert(!r.eql?(0...1))
104
    subclass = Class.new(Range)
105
    assert(r.eql?(subclass.new(0,1)))
102 106
  end
103 107

  
104 108
  def test_hash