1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby/test_lambda.rb: Remove "warning: assigned but unused variable"

This commit is contained in:
Yusuke Endoh 2021-04-04 15:26:09 +09:00
parent ffaaa2e65d
commit 2fcae4f90a

View file

@ -76,7 +76,7 @@ class TestLambdaParameters < Test::Unit::TestCase
def test_proc_inside_lambda_inside_method_return_inside_lambda_inside_method
def self.a
r = -> do
-> do
p = Proc.new{return :a}
p.call
end.call
@ -84,7 +84,7 @@ class TestLambdaParameters < Test::Unit::TestCase
assert_equal(:a, a)
def self.b
r = lambda do
lambda do
p = Proc.new{return :b}
p.call
end.call
@ -94,7 +94,7 @@ class TestLambdaParameters < Test::Unit::TestCase
def test_proc_inside_lambda_inside_method_return_inside_lambda_outside_method
def self.a
r = -> do
-> do
p = Proc.new{return :a}
p.call
end
@ -102,7 +102,7 @@ class TestLambdaParameters < Test::Unit::TestCase
assert_equal(:a, a.call)
def self.b
r = lambda do
lambda do
p = Proc.new{return :b}
p.call
end
@ -112,14 +112,14 @@ class TestLambdaParameters < Test::Unit::TestCase
def test_proc_inside_lambda_inside_method_return_outside_lambda_inside_method
def self.a
r = -> do
-> do
Proc.new{return :a}
end.call.call
end
assert_raise(LocalJumpError) {a}
def self.b
r = lambda do
lambda do
Proc.new{return :b}
end.call.call
end
@ -128,14 +128,14 @@ class TestLambdaParameters < Test::Unit::TestCase
def test_proc_inside_lambda_inside_method_return_outside_lambda_outside_method
def self.a
r = -> do
-> do
Proc.new{return :a}
end
end
assert_raise(LocalJumpError) {a.call.call}
def self.b
r = lambda do
lambda do
Proc.new{return :b}
end
end
@ -144,7 +144,7 @@ class TestLambdaParameters < Test::Unit::TestCase
def test_proc_inside_lambda2_inside_method_return_outside_lambda1_inside_method
def self.a
r = -> do
-> do
-> do
Proc.new{return :a}
end.call.call
@ -153,7 +153,7 @@ class TestLambdaParameters < Test::Unit::TestCase
assert_raise(LocalJumpError) {a}
def self.b
r = lambda do
lambda do
lambda do
Proc.new{return :a}
end.call.call