summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-07-31 14:10:09 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-07-31 14:10:09 +0000
commit41d6bc37e95bb51456d0d27da832c51cf701b5ee (patch)
treebe547c9f45474332e1e5fbf48a08bd545be4f61b /test
parent4e12051fe885f93eb5ce8eb114f6ee944b417035 (diff)
merge revision(s) d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e: [Backport #15786]
Add RB_ID_SERIAL_MAX Hide internal IDs * parse.y (internal_id): number the ID serial for internal use by counting down from the neary maximum value, not to accidentally match permanent IDs. [Bug #15768] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_method.rb5
-rw-r--r--test/ruby/test_proc.rb3
2 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 3b14b49577..3a7186584a 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -599,6 +599,11 @@ class TestMethod < Test::Unit::TestCase
assert_equal([[:req, :a], [:opt, :b], [:rest, :c], [:req, :d], [:keyrest, :o]], self.class.instance_method(:pmk7).parameters)
end
+ def test_hidden_parameters
+ instance_eval("def m((_)"+",(_)"*256+");end")
+ assert_empty(method(:m).parameters.map{|_,n|n}.compact)
+ end
+
def test_public_method_with_zsuper_method
c = Class.new
c.class_eval do
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 8e8f719892..9ae1de62ff 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -1137,6 +1137,9 @@ class TestProc < Test::Unit::TestCase
assert_equal([[:req]], method(:putc).parameters)
assert_equal([[:rest]], method(:p).parameters)
+
+ pr = eval("proc{|"+"(_),"*30+"|}")
+ assert_empty(pr.parameters.map{|_,n|n}.compact)
end
def pm0() end