From a19fa9b2bd94097e973fbdca48722c80b4d9b19f Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Wed, 10 May 2023 23:49:44 +0900 Subject: Prevent warning: assigned but unused variable http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230510T123003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/objspace/test_objspace.rb:224: warning: assigned but unused variable - c4 /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_class.rb:362: warning: assigned but unused variable - e /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_process.rb:2602: warning: assigned but unused variable - parent_pid ``` --- test/objspace/test_objspace.rb | 2 +- test/ruby/test_class.rb | 2 +- test/ruby/test_process.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index ee334fd58a..172bd6fff6 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -221,7 +221,7 @@ class TestObjSpace < Test::Unit::TestCase o4 = # This line intentionally left blank # This line intentionally left blank - 1.0 / 0.0; line4 = __LINE__; c4 = GC.count + 1.0 / 0.0; line4 = __LINE__; _c4 = GC.count assert_equal(__FILE__, ObjectSpace.allocation_sourcefile(o4)) assert_equal(line4, ObjectSpace.allocation_sourceline(o4)) diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index d1d196c9af..98acbaf67b 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -359,7 +359,7 @@ class TestClass < Test::Unit::TestCase assert_raise_with_message NameError, /uninitialized/ do begin eval('class ::TestClass::PrivateClass; end') - rescue NameError => e + rescue NameError end Object.const_get "NOT_AVAILABLE_CONST_NAME_#{__LINE__}" diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 66624644e9..8d42c588fe 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -2599,7 +2599,7 @@ EOS end if Process.respond_to?(:_fork) def test__fork_pid_cache - parent_pid = Process.pid + _parent_pid = Process.pid r, w = IO.pipe pid = Process._fork if pid == 0 -- cgit v1.2.1