From d41195a3bc2e40a15dd18adf2038de1266456cc6 Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 13 Jul 2009 15:47:20 +0000 Subject: * test/ruby/test_case.rb (TestCase#test_deoptimization): test for [ruby-core:23190]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_case.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3