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

ruby-changes:73745

From: Jeremy <ko1@a...>
Date: Tue, 27 Sep 2022 04:00:58 +0900 (JST)
Subject: [ruby-changes:73745] b39690df3a (master): Rename method name in keyword test from y to yo

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

From b39690df3a90a838cdb2de71e70a20651ebafaf4 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Mon, 26 Sep 2022 10:53:45 -0700
Subject: Rename method name in keyword test from y to yo

Kernel#y is defined by psych/yaml, which causes occasional
nondeterministic problems with this test when doing parallel testing.
---
 test/ruby/test_keyword.rb | 214 +++++++++++++++++++++++-----------------------
 1 file changed, 107 insertions(+), 107 deletions(-)

diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index 9978072744..94b5323ab0 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -247,17 +247,17 @@ class TestKeywordArguments < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L247
       assert_not_same(kw, res)
     end
 
-    def self.y(**kw) kw end
-    m = method(:y)
-    assert_equal(false, y(**{}).frozen?)
-    assert_equal_not_same(kw, y(**kw))
-    assert_equal_not_same(h, y(**h))
-    assert_equal(false, send(:y, **{}).frozen?)
-    assert_equal_not_same(kw, send(:y, **kw))
-    assert_equal_not_same(h, send(:y, **h))
-    assert_equal(false, public_send(:y, **{}).frozen?)
-    assert_equal_not_same(kw, public_send(:y, **kw))
-    assert_equal_not_same(h, public_send(:y, **h))
+    def self.yo(**kw) kw end
+    m = method(:yo)
+    assert_equal(false, yo(**{}).frozen?)
+    assert_equal_not_same(kw, yo(**kw))
+    assert_equal_not_same(h, yo(**h))
+    assert_equal(false, send(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, send(:yo, **kw))
+    assert_equal_not_same(h, send(:yo, **h))
+    assert_equal(false, public_send(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, public_send(:yo, **kw))
+    assert_equal_not_same(h, public_send(:yo, **h))
     assert_equal(false, m.(**{}).frozen?)
     assert_equal_not_same(kw, m.(**kw))
     assert_equal_not_same(h, m.(**h))
@@ -266,25 +266,25 @@ class TestKeywordArguments < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L266
     assert_equal_not_same(h, m.send(:call, **h))
 
     m = method(:send)
-    assert_equal(false, m.(:y, **{}).frozen?)
-    assert_equal_not_same(kw, m.(:y, **kw))
-    assert_equal_not_same(h, m.(:y, **h))
-    assert_equal(false, m.send(:call, :y,  **{}).frozen?)
-    assert_equal_not_same(kw, m.send(:call, :y, **kw))
-    assert_equal_not_same(h, m.send(:call, :y, **h))
-
-    singleton_class.send(:remove_method, :y)
-    define_singleton_method(:y) { |**kw| kw }
-    m = method(:y)
-    assert_equal(false, y(**{}).frozen?)
-    assert_equal_not_same(kw, y(**kw))
-    assert_equal_not_same(h, y(**h))
-    assert_equal(false, send(:y, **{}).frozen?)
-    assert_equal_not_same(kw, send(:y, **kw))
-    assert_equal_not_same(h, send(:y, **h))
-    assert_equal(false, public_send(:y, **{}).frozen?)
-    assert_equal_not_same(kw, public_send(:y, **kw))
-    assert_equal_not_same(h, public_send(:y, **h))
+    assert_equal(false, m.(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, m.(:yo, **kw))
+    assert_equal_not_same(h, m.(:yo, **h))
+    assert_equal(false, m.send(:call, :yo,  **{}).frozen?)
+    assert_equal_not_same(kw, m.send(:call, :yo, **kw))
+    assert_equal_not_same(h, m.send(:call, :yo, **h))
+
+    singleton_class.send(:remove_method, :yo)
+    define_singleton_method(:yo) { |**kw| kw }
+    m = method(:yo)
+    assert_equal(false, yo(**{}).frozen?)
+    assert_equal_not_same(kw, yo(**kw))
+    assert_equal_not_same(h, yo(**h))
+    assert_equal(false, send(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, send(:yo, **kw))
+    assert_equal_not_same(h, send(:yo, **h))
+    assert_equal(false, public_send(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, public_send(:yo, **kw))
+    assert_equal_not_same(h, public_send(:yo, **h))
     assert_equal(false, m.(**{}).frozen?)
     assert_equal_not_same(kw, m.(**kw))
     assert_equal_not_same(h, m.(**h))
@@ -292,17 +292,17 @@ class TestKeywordArguments < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L292
     assert_equal_not_same(kw, m.send(:call, **kw))
     assert_equal_not_same(h, m.send(:call, **h))
 
-    y = lambda { |**kw| kw }
-    m = y.method(:call)
-    assert_equal(false, y.(**{}).frozen?)
-    assert_equal_not_same(kw, y.(**kw))
-    assert_equal_not_same(h, y.(**h))
-    assert_equal(false, y.send(:call, **{}).frozen?)
-    assert_equal_not_same(kw, y.send(:call, **kw))
-    assert_equal_not_same(h, y.send(:call, **h))
-    assert_equal(false, y.public_send(:call, **{}).frozen?)
-    assert_equal_not_same(kw, y.public_send(:call, **kw))
-    assert_equal_not_same(h, y.public_send(:call, **h))
+    yo = lambda { |**kw| kw }
+    m = yo.method(:call)
+    assert_equal(false, yo.(**{}).frozen?)
+    assert_equal_not_same(kw, yo.(**kw))
+    assert_equal_not_same(h, yo.(**h))
+    assert_equal(false, yo.send(:call, **{}).frozen?)
+    assert_equal_not_same(kw, yo.send(:call, **kw))
+    assert_equal_not_same(h, yo.send(:call, **h))
+    assert_equal(false, yo.public_send(:call, **{}).frozen?)
+    assert_equal_not_same(kw, yo.public_send(:call, **kw))
+    assert_equal_not_same(h, yo.public_send(:call, **h))
     assert_equal(false, m.(**{}).frozen?)
     assert_equal_not_same(kw, m.(**kw))
     assert_equal_not_same(h, m.(**h))
@@ -310,17 +310,17 @@ class TestKeywordArguments < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L310
     assert_equal_not_same(kw, m.send(:call, **kw))
     assert_equal_not_same(h, m.send(:call, **h))
 
-    y = :y.to_proc
-    m = y.method(:call)
-    assert_equal(false, y.(self, **{}).frozen?)
-    assert_equal_not_same(kw, y.(self, **kw))
-    assert_equal_not_same(h, y.(self, **h))
-    assert_equal(false, y.send(:call, self, **{}).frozen?)
-    assert_equal_not_same(kw, y.send(:call, self, **kw))
-    assert_equal_not_same(h, y.send(:call, self, **h))
-    assert_equal(false, y.public_send(:call, self, **{}).frozen?)
-    assert_equal_not_same(kw, y.public_send(:call, self, **kw))
-    assert_equal_not_same(h, y.public_send(:call, self, **h))
+    yo = :yo.to_proc
+    m = yo.method(:call)
+    assert_equal(false, yo.(self, **{}).frozen?)
+    assert_equal_not_same(kw, yo.(self, **kw))
+    assert_equal_not_same(h, yo.(self, **h))
+    assert_equal(false, yo.send(:call, self, **{}).frozen?)
+    assert_equal_not_same(kw, yo.send(:call, self, **kw))
+    assert_equal_not_same(h, yo.send(:call, self, **h))
+    assert_equal(false, yo.public_send(:call, self, **{}).frozen?)
+    assert_equal_not_same(kw, yo.public_send(:call, self, **kw))
+    assert_equal_not_same(h, yo.public_send(:call, self, **h))
     assert_equal(false, m.(self, **{}).frozen?)
     assert_equal_not_same(kw, m.(self, **kw))
     assert_equal_not_same(h, m.(self, **h))
@@ -329,20 +329,20 @@ class TestKeywordArguments < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L329
     assert_equal_not_same(h, m.send(:call, self, **h))
 
     c = Class.new do
-      def y(**kw) kw end
+      def yo(**kw) kw end
     end
     o = c.new
-    def o.y(**kw) super end
-    m = o.method(:y)
-    assert_equal(false, o.y(**{}).frozen?)
-    assert_equal_not_same(kw, o.y(**kw))
-    assert_equal_not_same(h, o.y(**h))
-    assert_equal(false, o.send(:y, **{}).frozen?)
-    assert_equal_not_same(kw, o.send(:y, **kw))
-    assert_equal_not_same(h, o.send(:y, **h))
-    assert_equal(false, o.public_send(:y, **{}).frozen?)
-    assert_equal_not_same(kw, o.public_send(:y, **kw))
-    assert_equal_not_same(h, o.public_send(:y, **h))
+    def o.yo(**kw) super end
+    m = o.method(:yo)
+    assert_equal(false, o.yo(**{}).frozen?)
+    assert_equal_not_same(kw, o.yo(**kw))
+    assert_equal_not_same(h, o.yo(**h))
+    assert_equal(false, o.send(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, o.send(:yo, **kw))
+    assert_equal_not_same(h, o.send(:yo, **h))
+    assert_equal(false, o.public_send(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, o.public_send(:yo, **kw))
+    assert_equal_not_same(h, o.public_send(:yo, **h))
     assert_equal(false, m.(**{}).frozen?)
     assert_equal_not_same(kw, m.(**kw))
     assert_equal_not_same(h, m.(**h))
@@ -350,17 +350,17 @@ class TestKeywordArguments < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L350
     assert_equal_not_same(kw, m.send(:call, **kw))
     assert_equal_not_same(h, m.send(:call, **h))
 
-    o.singleton_class.send(:remove_method, :y)
-    def o.y(**kw) super(**kw) end
-    assert_equal(false, o.y(**{}).frozen?)
-    assert_equal_not_same(kw, o.y(**kw))
-    assert_equal_not_same(h, o.y(**h))
-    assert_equal(false, o.send(:y, **{}).frozen?)
-    assert_equal_not_same(kw, o.send(:y, **kw))
-    assert_equal_not_same(h, o.send(:y, **h))
-    assert_equal(false, o.public_send(:y, **{}).frozen?)
-    assert_equal_not_same(kw, o.public_send(:y, **kw))
-    assert_equal_not_same(h, o.public_send(:y, **h))
+    o.singleton_class.send(:remove_method, :yo)
+    def o.yo(**kw) super(**kw) end
+    assert_equal(false, o.yo(**{}).frozen?)
+    assert_equal_not_same(kw, o.yo(**kw))
+    assert_equal_not_same(h, o.yo(**h))
+    assert_equal(false, o.send(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, o.send(:yo, **kw))
+    assert_equal_not_same(h, o.send(:yo, **h))
+    assert_equal(false, o.public_send(:yo, **{}).frozen?)
+    assert_equal_not_same(kw, o.public_send(:yo, **kw))
+    assert_equal_not_same(h, o.public_send(:yo, **h))
     assert_equal(false, m.(**{}).frozen?)
     assert_equal_not_same(kw, m.(**kw))
     assert_equal_not_same(h, m.(**h))
@@ -372,17 +372,17 @@ class TestKeywordArguments < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_keyword.rb#L372
       def method_missing(_, **kw) kw end
     end
     o = c.new
-    def o.y(**kw) super end
-    m = o.method(:y)
-    assert_equal(false, o.y(* (... truncated)

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

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