summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2025-02-13 17:51:03 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2025-02-13 17:51:03 -0800
commitd720ea59ca36f726b8484b3b66e3e2c40784ac89 (patch)
tree6d6b75a5473f35afc51458313c18ac29ca94b2f0 /test/ruby
parent5ba052675f0eefe77dd7ab30bb9ac186f8d82ccb (diff)
merge revision(s) 2a1cff40f5e7875f69a7d0ed59eab92cc86c65ff: [Backport #21003]
Do not warn unused block when using forwarding Fixes [Bug #21003]
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_method.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 0707d61f1b..5d5d5aac02 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -1776,5 +1776,13 @@ class TestMethod < Test::Unit::TestCase
RUBY
assert_equal 0, err.size, err.join("\n")
end
+
+ assert_in_out_err '-w', <<-'RUBY' do |_out, err, _status|
+ def foo(*, &block) = block
+ def bar(buz, ...) = foo(buz, ...)
+ bar(:test) {} # do not warn because of forwarding
+ RUBY
+ assert_equal 0, err.size, err.join("\n")
+ end
end
end