summaryrefslogtreecommitdiff
path: root/test/ruby/test_optimization.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_optimization.rb')
-rw-r--r--test/ruby/test_optimization.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index 1c50044f7f1..3573d1267f2 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -362,4 +362,15 @@ class TestRubyOptimization < Test::Unit::TestCase
assert_redefine_method(k, '===', "assert_equal(#{v.inspect} === 0, 0)")
end
end
+
+ def test_opt_case_dispatch_inf
+ inf = 1.0/0.0
+ result = case inf
+ when 1 then 1
+ when 0 then 0
+ else
+ inf.to_i rescue nil
+ end
+ assert_nil result, '[ruby-dev:49423] [Bug #11804]'
+ end
end