summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-05 04:41:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-05 04:41:05 +0000
commit738ce30f99bf034468606d2e0fb56af7a217c549 (patch)
tree06ab534efbb9c570ff231ca90901b3c6dcc4ae11 /test
parent73645c1c51847198e2195d36cc8be17fbe63db25 (diff)
convert method name to a Symbol
* vm_eval.c (send_internal), vm_insnhelper.c (vm_call_opt_send): convert String method name into a Symbol, as method_missing method expects its first argument to be a Symbol. [Bug #10828] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/-ext-/symbol/test_inadvertent_creation.rb b/test/-ext-/symbol/test_inadvertent_creation.rb
index cd8ad8c..a929902 100644
--- a/test/-ext-/symbol/test_inadvertent_creation.rb
+++ b/test/-ext-/symbol/test_inadvertent_creation.rb
@@ -379,17 +379,17 @@ module Test_Symbol
def test_send_leak_string_custom_method_missing
x = Object.new
- def x.method_missing(*); end
+ def x.method_missing(*); super; end
assert_no_immortal_symbol_created("send should not leak - str mm") do |name|
- assert_nothing_raised(NoMethodError) {x.send(name)}
+ assert_raise(NoMethodError) {x.send(name)}
end
end
def test_send_leak_symbol_custom_method_missing
x = Object.new
- def x.method_missing(*); end
+ def x.method_missing(*); super; end
assert_no_immortal_symbol_created("send should not leak - sym mm") do |name|
- assert_nothing_raised(NoMethodError) {x.send(name.to_sym)}
+ assert_raise(NoMethodError) {x.send(name.to_sym)}
end
end
@@ -407,17 +407,17 @@ module Test_Symbol
def test_send_leak_string_custom_method_missing_no_optimization
x = Object.new
- def x.method_missing(*); end
+ def x.method_missing(*); super; end
assert_no_immortal_symbol_created("send should not leak - str mm slow") do |name|
- assert_nothing_raised(NoMethodError) {x.method(:send).call(name)}
+ assert_raise(NoMethodError) {x.method(:send).call(name)}
end
end
def test_send_leak_symbol_custom_method_missing_no_optimization
x = Object.new
- def x.method_missing(*); end
+ def x.method_missing(*); super; end
assert_no_immortal_symbol_created("send should not leak - sym mm slow") do |name|
- assert_nothing_raised(NoMethodError) {x.method(:send).call(name.to_sym)}
+ assert_raise(NoMethodError) {x.method(:send).call(name.to_sym)}
end
end
end