cdhash_cmp: can also take complex

There are complex literals `123i`, which can also be a case condition.
This commit is contained in:
卜部昌平 2021-05-07 12:49:32 +09:00
parent d0e6c6e682
commit cc0dc67bbb
Notes: git 2021-05-12 10:31:14 +09:00
4 changed files with 25 additions and 7 deletions

View file

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