summaryrefslogtreecommitdiff
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-15 04:37:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-15 04:37:26 +0000
commitc2e8fb0f34999739cff9c9e2d637346079b9365f (patch)
treea49f1ca0bb1b070c525b5ba80a8dc644f10ecc62 /test/ruby/test_symbol.rb
parentd0e86105829192d982016d5e8badea950a76b6dd (diff)
proc.c: proc without env
* proc.c (rb_sym_to_proc): move from string.c and create a Proc with no environments. [ruby-core:71088] [Bug #11594] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 1329ea22ab..07b75b0024 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -147,6 +147,14 @@ class TestSymbol < Test::Unit::TestCase
end;
end
+ def test_to_proc_call_with_symbol_proc
+ first = 1
+ bug11594 = "[ruby-core:71088] [Bug #11594] corrupted the first local variable"
+ # symbol which does not have a Proc
+ ->(&blk) {}.call(&:test_to_proc_call_with_symbol_proc)
+ assert_equal(1, first, bug11594)
+ end
+
def test_call
o = Object.new
def o.foo(x, y); x + y; end