ruby-changes:65754
From: Yusuke <ko1@a...>
Date: Sun, 4 Apr 2021 15:35:31 +0900 (JST)
Subject: [ruby-changes:65754] 2fcae4f90a (master): test/ruby/test_lambda.rb: Remove "warning: assigned but unused variable"
https://git.ruby-lang.org/ruby.git/commit/?id=2fcae4f90a From 2fcae4f90ab08ae06c28c4aa0989ee06d97f0536 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Sun, 4 Apr 2021 15:26:09 +0900 Subject: test/ruby/test_lambda.rb: Remove "warning: assigned but unused variable" --- test/ruby/test_lambda.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb index 2c42b54..9949fab 100644 --- a/test/ruby/test_lambda.rb +++ b/test/ruby/test_lambda.rb @@ -76,7 +76,7 @@ class TestLambdaParameters < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L76 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L84 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L94 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L102 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L112 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L128 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L144 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L153 assert_raise(LocalJumpError) {a} def self.b - r = lambda do + lambda do lambda do Proc.new{return :a} end.call.call -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/