summaryrefslogtreecommitdiff
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-26 10:00:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-26 10:00:36 +0000
commitaf2670f1a445a62c4e14f74eebdd3a30816361ad (patch)
treed13b8dd8f9b24fd85a4a920b964f3e069e33b9d9 /test/ruby/test_symbol.rb
parentbb7b5a063129c344dbe3e52be055bdbbf160cdc8 (diff)
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/trunk@57194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_symbol.rb')
-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 4a7ca700c9..42b5106298 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -201,6 +201,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