summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_range.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index b4c078915df..9dfd29012ab 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -89,6 +89,8 @@ class TestRange < Test::Unit::TestCase
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
@@ -99,6 +101,8 @@ class TestRange < Test::Unit::TestCase
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