зеркало из https://github.com/github/ruby.git
bootstraptest/test_knownbug.rb: add tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6b36f117f2
Коммит
db0c3eb8c0
|
@ -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]"
|
||||
|
|
Загрузка…
Ссылка в новой задаче