summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 15:47:20 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 15:47:20 +0000
commitd41195a3bc2e40a15dd18adf2038de1266456cc6 (patch)
tree817ab8ed97b95fac7acaa58cb8d2fa973bc0fddb /test/ruby
parent7287b852da95b3bee1395fd80752e62b686da294 (diff)
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_case.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_case.rb b/test/ruby/test_case.rb
index 41a2203..0123e74 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