summaryrefslogtreecommitdiff
path: root/spec/ruby/language/case_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/case_spec.rb')
-rw-r--r--spec/ruby/language/case_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/language/case_spec.rb b/spec/ruby/language/case_spec.rb
index 1475e20f75..410cb9afb1 100644
--- a/spec/ruby/language/case_spec.rb
+++ b/spec/ruby/language/case_spec.rb
@@ -424,4 +424,13 @@ describe "The 'case'-construct with no target expression" do
:called
end.should == :called
end
+
+ # Homogeneous cases are often optimized to avoid === using a jump table, and should be tested separately.
+ # See https://github.com/jruby/jruby/issues/6440
+ it "handles homogeneous cases" do
+ case
+ when 1; 'foo'
+ when 2; 'bar'
+ end.should == 'foo'
+ end
end