summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2024-04-15 14:22:40 +0900
committerKoichi Sasada <ko1@atdot.net>2024-04-15 14:53:41 +0900
commit145cced9bcb6a52fccfa0c669121bd07d3b3ff74 (patch)
tree6475987e99be7f57c14684e2ac1695388527d706 /test/ruby
parentb6a10a15180250cef9ec2bacedb71fa392ac0b8d (diff)
fix incorrect warning.
`super()` (not zsuper) passes the passed block and it can be used. ```ruby class C0 def foo; yield; end end class C1 < C0 def foo; super(); end end C1.new.foo{p :block} #=> :block ```
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_method.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 67b3e03e10..34b58a1f51 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -1666,20 +1666,25 @@ class TestMethod < Test::Unit::TestCase
def foo = nil
def bar = nil
def baz = nil
+ def qux = nil
end
class C1 < C0
def foo = super
def bar = super()
def baz(&_) = super(&_)
+ def qux = super(&nil)
end
C1.new.foo{} # no warning
- C1.new.bar{} # warning
+ C1.new.bar{} # no warning
C1.new.baz{} # no warning
+ # C1.new.qux{} # TODO: warning line:16 but not supported yet.
RUBY
- assert_equal 1, err.size
- assert_match(/-:14: warning.+bar/, err.join)
+ assert_equal 0, err.size
+ # TODO
+ # assert_equal 1, err.size
+ # assert_match(/-:16: warning.+qux/, err.join)
end
end
end