cdhash_cmp: rational literals with fractions

Nobu kindly pointed out that rational literals can have fractions.
This commit is contained in:
卜部昌平 2021-05-07 11:07:11 +09:00
parent 2bc293e899
commit d0e6c6e682
Notes: git 2021-05-12 10:31:14 +09:00
2 changed files with 7 additions and 2 deletions

View file

@ -835,6 +835,10 @@ class Rational_Test < Test::Unit::TestCase
n = case 1 when 2r then false else true end
assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
RUBY
assert_separately([], <<-RUBY)
n = case 3/2r when 1.5r then true else false end
assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
RUBY
end
def test_Rational_with_invalid_exception