Prevent "assigned but unused variable" warnings
This commit is contained in:
parent
fc67091fc8
commit
cb30c3d2b3
@ -133,6 +133,9 @@ class TestCall < Test::Unit::TestCase
|
|||||||
kw = {}
|
kw = {}
|
||||||
b = lambda{}
|
b = lambda{}
|
||||||
|
|
||||||
|
# Prevent "assigned but unused variable" warnings
|
||||||
|
_ = [h, a, kw, b]
|
||||||
|
|
||||||
message = /keyword arg given in index/
|
message = /keyword arg given in index/
|
||||||
|
|
||||||
# +=, without block, non-popped
|
# +=, without block, non-popped
|
||||||
@ -294,6 +297,9 @@ class TestCall < Test::Unit::TestCase
|
|||||||
a = []
|
a = []
|
||||||
kw = {}
|
kw = {}
|
||||||
|
|
||||||
|
# Prevent "assigned but unused variable" warnings
|
||||||
|
_ = [h, a, kw]
|
||||||
|
|
||||||
assert_syntax_error(%q{h[*a, 2, b: 5, **kw] += 1}, message)
|
assert_syntax_error(%q{h[*a, 2, b: 5, **kw] += 1}, message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -498,6 +498,10 @@ class TestParse < Test::Unit::TestCase
|
|||||||
t = Object.new
|
t = Object.new
|
||||||
a = []
|
a = []
|
||||||
blk = proc {|x| a << x }
|
blk = proc {|x| a << x }
|
||||||
|
|
||||||
|
# Prevent an "assigned but unused variable" warning
|
||||||
|
_ = blk
|
||||||
|
|
||||||
def t.[](_)
|
def t.[](_)
|
||||||
yield(:aref)
|
yield(:aref)
|
||||||
nil
|
nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user