diff options
Diffstat (limited to 'test/ruby/test_case.rb')
-rw-r--r-- | test/ruby/test_case.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_case.rb b/test/ruby/test_case.rb index 41a22038a0..0123e7422f 100644 --- a/test/ruby/test_case.rb +++ b/test/ruby/test_case.rb @@ -1,4 +1,5 @@ require 'test/unit' +require 'envutil.rb' class TestCase < Test::Unit::TestCase def test_case @@ -46,4 +47,14 @@ class TestCase < Test::Unit::TestCase assert(false) end end + + def test_deoptimization + assert_in_out_err(['-e', <<-EOS], '', %w[42], []) + class Symbol; def ===(o); p 42; true; end; end; case :foo; when :foo; end + EOS + + assert_in_out_err(['-e', <<-EOS], '', %w[42], []) + class Fixnum; def ===(o); p 42; true; end; end; case 1; when 1; end + EOS + end end |