1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* complex.c (nucomp_hash), rational.c (nurat_hash): not to use

hash value of class so that equality against subclasses can
  work.  [ruby-dev:38850]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-07-25 04:44:36 +00:00
parent 4fd615943e
commit d6ab828369
5 changed files with 19 additions and 8 deletions

View file

@ -35,6 +35,10 @@ class Rational_Test < Test::Unit::TestCase
assert_equal(c, c5)
assert_instance_of(RationalSub, c5)
end
c1 = Rational(1)
assert_equal(c1.hash, c.hash, '[ruby-dev:38850]')
assert_equal([true, true], [c.eql?(c1), c1.eql?(c)])
end
def test_eql_p