summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-11 11:06:39 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-11 11:06:39 +0000
commit927c116d0c098a28082a22b15d7daa26ed560591 (patch)
tree7ec3a5d993bafd5d8f9082ec3b52ee7826322851 /test
parent7b560e31be52b880711204df6992c84185eac6cf (diff)
merge revision(s) 57194: [Backport #13074]
vm_eval.c: Symbol#to_proc and instance_exec * vm_eval.c (yield_under): should evaluate the proc on the first argument. [ruby-core:78839] [Bug #13074] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_symbol.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 4461e51d61..636ec0a6a9 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -194,6 +194,12 @@ class TestSymbol < Test::Unit::TestCase
end;
end
+ def test_to_proc_instance_exec
+ bug = '[ruby-core:78839] [Bug #13074] should evaluate on the argument'
+ assert_equal(2, BasicObject.new.instance_exec(1, &:succ), bug)
+ assert_equal(3, BasicObject.new.instance_exec(1, 2, &:+), bug)
+ end
+
def test_call
o = Object.new
def o.foo(x, y); x + y; end