Suppress warnings for variables

This commit is contained in:
Nobuyoshi Nakada 2025-07-16 00:03:04 +09:00
parent f5312d8e7f
commit 35660ec17d
No known key found for this signature in database
GPG key ID: 3582D74E1FEE4465
3 changed files with 5 additions and 4 deletions

View file

@ -1655,7 +1655,7 @@ class TestProc < Test::Unit::TestCase
def test_numparam_is_not_local_variables
"foo".tap do
_9
_9 and flunk
assert_equal([], binding.local_variables)
assert_raise(NameError) { binding.local_variable_get(:_9) }
assert_raise(NameError) { binding.local_variable_set(:_9, 1) }
@ -1674,7 +1674,7 @@ class TestProc < Test::Unit::TestCase
assert_raise(NameError) { binding.local_variable_get(:_9) }
assert_raise(NameError) { binding.local_variable_set(:_9, 1) }
"bar".tap do
_9
_9 and flunk
assert_equal([], binding.local_variables)
assert_raise(NameError) { binding.local_variable_get(:_9) }
assert_raise(NameError) { binding.local_variable_set(:_9, 1) }

View file

@ -875,7 +875,7 @@ class TestRubyOptions < Test::Unit::TestCase
'-e', '$".clear',
'-e', '$".unshift Bogus.new',
'-e', '(p $"; abort) unless $".size == 1',
], success: false)
], bug7402, success: false)
end
def test_segv_setproctitle

View file

@ -419,6 +419,7 @@ class TestVariable < Test::Unit::TestCase
x
end
end
objs or flunk
end
def test_local_variables_with_kwarg
@ -440,7 +441,7 @@ class TestVariable < Test::Unit::TestCase
end
def test_local_variables_encoding
α = 1
α = 1 or flunk
b = binding
b.eval("".encode("us-ascii"))
assert_equal(%i[α b], b.local_variables)