From db0c3eb8c02ef6a1c280c88260e10fb5c3f5be23 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 12 Apr 2008 14:51:09 +0000 Subject: bootstraptest/test_knownbug.rb: add tests git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_knownbug.rb | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index 5ffd99a8ea..7a3b5476e9 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -110,3 +110,48 @@ assert_equal %q{[:bar, :foo]}, %q{ foo }, "[ ruby-Bugs-19304 ]" +assert_equal 'ok', %q{ + def a() end + begin + if defined?(a(1).a) + :ok + else + :ng + end + rescue + :ng + end +}, '[ruby-core:16010]' + +assert_equal 'ok', %q{ + def a() end + begin + if defined?(a::B) + :ok + else + :ng + end + rescue + :ng + end +}, '[ruby-core:16010]' + + +assert_equal 'ok', %q{ + class Module + def my_module_eval(&block) + module_eval(&block) + end + end + class String + Integer.my_module_eval do + def hoge; end + end + end + if Integer.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) && + !String.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) + :ok + else + :ng + end +}, "[ruby-dev:34236]" -- cgit v1.2.3