summaryrefslogtreecommitdiffstats
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
commit08773eab2dc39ead0802db2764f4a163c50178eb (patch)
tree817ab8ed97b95fac7acaa58cb8d2fa973bc0fddb /test/ruby
parent60558c8cfb878dd1844f3f4a0e78f3fe049f1652 (diff)
downloadruby-08773eab2dc39ead0802db2764f4a163c50178eb.tar.gz
ruby-08773eab2dc39ead0802db2764f4a163c50178eb.tar.xz
ruby-08773eab2dc39ead0802db2764f4a163c50178eb.zip
* test/ruby/test_case.rb (TestCase#test_deoptimization):
test for [ruby-core:23190]. git-svn-id: http://svn.ruby-lang.org/repos/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 41a22038a..0123e7422 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