[前][次][番号順一覧][スレッド一覧]

ruby-changes:69927

From: Yusuke <ko1@a...>
Date: Thu, 25 Nov 2021 11:01:39 +0900 (JST)
Subject: [ruby-changes:69927] b5aa161383 (master): test/ruby/test_iseq.rb: Avoid pollution of method namespace

https://git.ruby-lang.org/ruby.git/commit/?id=b5aa161383

From b5aa161383ec214b1d6296ea5c76dfe28737821f Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Thu, 25 Nov 2021 11:00:28 +0900
Subject: test/ruby/test_iseq.rb: Avoid pollution of method namespace

http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20211125T003004Z.log.html.gz
```
[ 4780/21204] TestISeq#test_super_with_anonymous_block/home/chkbuild/chkbuild/tmp/build/20211125T003004Z/ruby/test/ruby/test_iseq.rb:141: warning: method redefined; discarding old touch3
/home/chkbuild/chkbuild/tmp/build/20211125T003004Z/ruby/test/ruby/test_iseq.rb:121: warning: previous definition of touch3 was here
 = 0.00 s
```
---
 test/ruby/test_iseq.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index d106caa8408..847ce6995cf 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -97,7 +97,7 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L97
 
   def test_super_with_block
     iseq = compile(<<~EOF, __LINE__+1)
-      def touch(*) # :nodoc:
+      def (Object.new).touch(*) # :nodoc:
         foo { super }
       end
       42
@@ -108,7 +108,7 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L108
   def test_super_with_block_hash_0
     iseq = compile(<<~EOF, __LINE__+1)
       # [Bug #18250] `req` specifically cause `Assertion failed: (key != 0), function hash_table_raw_insert`
-      def touch2(req, *)
+      def (Object.new).touch(req, *)
         foo { super }
       end
       42
@@ -118,7 +118,7 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L118
 
   def test_super_with_block_and_kwrest
     iseq = compile(<<~EOF, __LINE__+1)
-      def touch3(**) # :nodoc:
+      def (Object.new).touch(**) # :nodoc:
         foo { super }
       end
       42
@@ -138,7 +138,7 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L138
 
   def test_super_with_anonymous_block
     iseq = compile(<<~EOF, __LINE__+1)
-      def touch3(&) # :nodoc:
+      def (Object.new).touch(&) # :nodoc:
         foo { super }
       end
       42
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]