summaryrefslogtreecommitdiff
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 94541865f2..8960bec0d1 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -164,6 +164,18 @@ class TestSymbol < Test::Unit::TestCase
end;
end
+ def test_to_proc_iseq
+ assert_separately([], <<~"end;", timeout: 1) # do
+ bug11845 = '[ruby-core:72381] [Bug #11845]'
+ assert_nil(:class.to_proc.source_location, bug11845)
+ assert_equal([[:rest]], :class.to_proc.parameters, bug11845)
+ c = Class.new {define_method(:klass, :class.to_proc)}
+ m = c.instance_method(:klass)
+ assert_nil(m.source_location, bug11845)
+ assert_equal([[:rest]], m.parameters, bug11845)
+ end;
+ end
+
def test_call
o = Object.new
def o.foo(x, y); x + y; end