summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2021-05-07 12:49:32 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2021-05-12 10:30:46 +0900
commitcc0dc67bbbe1951ff90004bc987f78545625d772 (patch)
treeb6bf1c68d335875409ecd96bf56ef6e5dec64f92 /test
parentd0e6c6e682b9ba2b0309a5177933a0628e8ef316 (diff)
cdhash_cmp: can also take complex
There are complex literals `123i`, which can also be a case condition.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4469
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rational.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index 5262b6edad..27d0527d42 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -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