Skip to content

Commit b39690d

Browse files
committed
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.
1 parent aa2a428 commit b39690d

File tree

1 file changed

+107
-107
lines changed

1 file changed

+107
-107
lines changed

test/ruby/test_keyword.rb

Lines changed: 107 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,17 @@ def self.assert_equal_not_same(kw, res)
247247
assert_not_same(kw, res)
248248
end
249249

250-
def self.y(**kw) kw end
251-
m = method(:y)
252-
assert_equal(false, y(**{}).frozen?)
253-
assert_equal_not_same(kw, y(**kw))
254-
assert_equal_not_same(h, y(**h))
255-
assert_equal(false, send(:y, **{}).frozen?)
256-
assert_equal_not_same(kw, send(:y, **kw))
257-
assert_equal_not_same(h, send(:y, **h))
258-
assert_equal(false, public_send(:y, **{}).frozen?)
259-
assert_equal_not_same(kw, public_send(:y, **kw))
260-
assert_equal_not_same(h, public_send(:y, **h))
250+
def self.yo(**kw) kw end
251+
m = method(:yo)
252+
assert_equal(false, yo(**{}).frozen?)
253+
assert_equal_not_same(kw, yo(**kw))
254+
assert_equal_not_same(h, yo(**h))
255+
assert_equal(false, send(:yo, **{}).frozen?)
256+
assert_equal_not_same(kw, send(:yo, **kw))
257+
assert_equal_not_same(h, send(:yo, **h))
258+
assert_equal(false, public_send(:yo, **{}).frozen?)
259+
assert_equal_not_same(kw, public_send(:yo, **kw))
260+
assert_equal_not_same(h, public_send(:yo, **h))
261261
assert_equal(false, m.(**{}).frozen?)
262262
assert_equal_not_same(kw, m.(**kw))
263263
assert_equal_not_same(h, m.(**h))
@@ -266,61 +266,61 @@ def self.y(**kw) kw end
266266
assert_equal_not_same(h, m.send(:call, **h))
267267

268268
m = method(:send)
269-
assert_equal(false, m.(:y, **{}).frozen?)
270-
assert_equal_not_same(kw, m.(:y, **kw))
271-
assert_equal_not_same(h, m.(:y, **h))
272-
assert_equal(false, m.send(:call, :y, **{}).frozen?)
273-
assert_equal_not_same(kw, m.send(:call, :y, **kw))
274-
assert_equal_not_same(h, m.send(:call, :y, **h))
275-
276-
singleton_class.send(:remove_method, :y)
277-
define_singleton_method(:y) { |**kw| kw }
278-
m = method(:y)
279-
assert_equal(false, y(**{}).frozen?)
280-
assert_equal_not_same(kw, y(**kw))
281-
assert_equal_not_same(h, y(**h))
282-
assert_equal(false, send(:y, **{}).frozen?)
283-
assert_equal_not_same(kw, send(:y, **kw))
284-
assert_equal_not_same(h, send(:y, **h))
285-
assert_equal(false, public_send(:y, **{}).frozen?)
286-
assert_equal_not_same(kw, public_send(:y, **kw))
287-
assert_equal_not_same(h, public_send(:y, **h))
269+
assert_equal(false, m.(:yo, **{}).frozen?)
270+
assert_equal_not_same(kw, m.(:yo, **kw))
271+
assert_equal_not_same(h, m.(:yo, **h))
272+
assert_equal(false, m.send(:call, :yo, **{}).frozen?)
273+
assert_equal_not_same(kw, m.send(:call, :yo, **kw))
274+
assert_equal_not_same(h, m.send(:call, :yo, **h))
275+
276+
singleton_class.send(:remove_method, :yo)
277+
define_singleton_method(:yo) { |**kw| kw }
278+
m = method(:yo)
279+
assert_equal(false, yo(**{}).frozen?)
280+
assert_equal_not_same(kw, yo(**kw))
281+
assert_equal_not_same(h, yo(**h))
282+
assert_equal(false, send(:yo, **{}).frozen?)
283+
assert_equal_not_same(kw, send(:yo, **kw))
284+
assert_equal_not_same(h, send(:yo, **h))
285+
assert_equal(false, public_send(:yo, **{}).frozen?)
286+
assert_equal_not_same(kw, public_send(:yo, **kw))
287+
assert_equal_not_same(h, public_send(:yo, **h))
288288
assert_equal(false, m.(**{}).frozen?)
289289
assert_equal_not_same(kw, m.(**kw))
290290
assert_equal_not_same(h, m.(**h))
291291
assert_equal(false, m.send(:call, **{}).frozen?)
292292
assert_equal_not_same(kw, m.send(:call, **kw))
293293
assert_equal_not_same(h, m.send(:call, **h))
294294

295-
y = lambda { |**kw| kw }
296-
m = y.method(:call)
297-
assert_equal(false, y.(**{}).frozen?)
298-
assert_equal_not_same(kw, y.(**kw))
299-
assert_equal_not_same(h, y.(**h))
300-
assert_equal(false, y.send(:call, **{}).frozen?)
301-
assert_equal_not_same(kw, y.send(:call, **kw))
302-
assert_equal_not_same(h, y.send(:call, **h))
303-
assert_equal(false, y.public_send(:call, **{}).frozen?)
304-
assert_equal_not_same(kw, y.public_send(:call, **kw))
305-
assert_equal_not_same(h, y.public_send(:call, **h))
295+
yo = lambda { |**kw| kw }
296+
m = yo.method(:call)
297+
assert_equal(false, yo.(**{}).frozen?)
298+
assert_equal_not_same(kw, yo.(**kw))
299+
assert_equal_not_same(h, yo.(**h))
300+
assert_equal(false, yo.send(:call, **{}).frozen?)
301+
assert_equal_not_same(kw, yo.send(:call, **kw))
302+
assert_equal_not_same(h, yo.send(:call, **h))
303+
assert_equal(false, yo.public_send(:call, **{}).frozen?)
304+
assert_equal_not_same(kw, yo.public_send(:call, **kw))
305+
assert_equal_not_same(h, yo.public_send(:call, **h))
306306
assert_equal(false, m.(**{}).frozen?)
307307
assert_equal_not_same(kw, m.(**kw))
308308
assert_equal_not_same(h, m.(**h))
309309
assert_equal(false, m.send(:call, **{}).frozen?)
310310
assert_equal_not_same(kw, m.send(:call, **kw))
311311
assert_equal_not_same(h, m.send(:call, **h))
312312

313-
y = :y.to_proc
314-
m = y.method(:call)
315-
assert_equal(false, y.(self, **{}).frozen?)
316-
assert_equal_not_same(kw, y.(self, **kw))
317-
assert_equal_not_same(h, y.(self, **h))
318-
assert_equal(false, y.send(:call, self, **{}).frozen?)
319-
assert_equal_not_same(kw, y.send(:call, self, **kw))
320-
assert_equal_not_same(h, y.send(:call, self, **h))
321-
assert_equal(false, y.public_send(:call, self, **{}).frozen?)
322-
assert_equal_not_same(kw, y.public_send(:call, self, **kw))
323-
assert_equal_not_same(h, y.public_send(:call, self, **h))
313+
yo = :yo.to_proc
314+
m = yo.method(:call)
315+
assert_equal(false, yo.(self, **{}).frozen?)
316+
assert_equal_not_same(kw, yo.(self, **kw))
317+
assert_equal_not_same(h, yo.(self, **h))
318+
assert_equal(false, yo.send(:call, self, **{}).frozen?)
319+
assert_equal_not_same(kw, yo.send(:call, self, **kw))
320+
assert_equal_not_same(h, yo.send(:call, self, **h))
321+
assert_equal(false, yo.public_send(:call, self, **{}).frozen?)
322+
assert_equal_not_same(kw, yo.public_send(:call, self, **kw))
323+
assert_equal_not_same(h, yo.public_send(:call, self, **h))
324324
assert_equal(false, m.(self, **{}).frozen?)
325325
assert_equal_not_same(kw, m.(self, **kw))
326326
assert_equal_not_same(h, m.(self, **h))
@@ -329,38 +329,38 @@ def self.y(**kw) kw end
329329
assert_equal_not_same(h, m.send(:call, self, **h))
330330

331331
c = Class.new do
332-
def y(**kw) kw end
332+
def yo(**kw) kw end
333333
end
334334
o = c.new
335-
def o.y(**kw) super end
336-
m = o.method(:y)
337-
assert_equal(false, o.y(**{}).frozen?)
338-
assert_equal_not_same(kw, o.y(**kw))
339-
assert_equal_not_same(h, o.y(**h))
340-
assert_equal(false, o.send(:y, **{}).frozen?)
341-
assert_equal_not_same(kw, o.send(:y, **kw))
342-
assert_equal_not_same(h, o.send(:y, **h))
343-
assert_equal(false, o.public_send(:y, **{}).frozen?)
344-
assert_equal_not_same(kw, o.public_send(:y, **kw))
345-
assert_equal_not_same(h, o.public_send(:y, **h))
335+
def o.yo(**kw) super end
336+
m = o.method(:yo)
337+
assert_equal(false, o.yo(**{}).frozen?)
338+
assert_equal_not_same(kw, o.yo(**kw))
339+
assert_equal_not_same(h, o.yo(**h))
340+
assert_equal(false, o.send(:yo, **{}).frozen?)
341+
assert_equal_not_same(kw, o.send(:yo, **kw))
342+
assert_equal_not_same(h, o.send(:yo, **h))
343+
assert_equal(false, o.public_send(:yo, **{}).frozen?)
344+
assert_equal_not_same(kw, o.public_send(:yo, **kw))
345+
assert_equal_not_same(h, o.public_send(:yo, **h))
346346
assert_equal(false, m.(**{}).frozen?)
347347
assert_equal_not_same(kw, m.(**kw))
348348
assert_equal_not_same(h, m.(**h))
349349
assert_equal(false, m.send(:call, **{}).frozen?)
350350
assert_equal_not_same(kw, m.send(:call, **kw))
351351
assert_equal_not_same(h, m.send(:call, **h))
352352

353-
o.singleton_class.send(:remove_method, :y)
354-
def o.y(**kw) super(**kw) end
355-
assert_equal(false, o.y(**{}).frozen?)
356-
assert_equal_not_same(kw, o.y(**kw))
357-
assert_equal_not_same(h, o.y(**h))
358-
assert_equal(false, o.send(:y, **{}).frozen?)
359-
assert_equal_not_same(kw, o.send(:y, **kw))
360-
assert_equal_not_same(h, o.send(:y, **h))
361-
assert_equal(false, o.public_send(:y, **{}).frozen?)
362-
assert_equal_not_same(kw, o.public_send(:y, **kw))
363-
assert_equal_not_same(h, o.public_send(:y, **h))
353+
o.singleton_class.send(:remove_method, :yo)
354+
def o.yo(**kw) super(**kw) end
355+
assert_equal(false, o.yo(**{}).frozen?)
356+
assert_equal_not_same(kw, o.yo(**kw))
357+
assert_equal_not_same(h, o.yo(**h))
358+
assert_equal(false, o.send(:yo, **{}).frozen?)
359+
assert_equal_not_same(kw, o.send(:yo, **kw))
360+
assert_equal_not_same(h, o.send(:yo, **h))
361+
assert_equal(false, o.public_send(:yo, **{}).frozen?)
362+
assert_equal_not_same(kw, o.public_send(:yo, **kw))
363+
assert_equal_not_same(h, o.public_send(:yo, **h))
364364
assert_equal(false, m.(**{}).frozen?)
365365
assert_equal_not_same(kw, m.(**kw))
366366
assert_equal_not_same(h, m.(**h))
@@ -372,35 +372,35 @@ def o.y(**kw) super(**kw) end
372372
def method_missing(_, **kw) kw end
373373
end
374374
o = c.new
375-
def o.y(**kw) super end
376-
m = o.method(:y)
377-
assert_equal(false, o.y(**{}).frozen?)
378-
assert_equal_not_same(kw, o.y(**kw))
379-
assert_equal_not_same(h, o.y(**h))
380-
assert_equal(false, o.send(:y, **{}).frozen?)
381-
assert_equal_not_same(kw, o.send(:y, **kw))
382-
assert_equal_not_same(h, o.send(:y, **h))
383-
assert_equal(false, o.public_send(:y, **{}).frozen?)
384-
assert_equal_not_same(kw, o.public_send(:y, **kw))
385-
assert_equal_not_same(h, o.public_send(:y, **h))
375+
def o.yo(**kw) super end
376+
m = o.method(:yo)
377+
assert_equal(false, o.yo(**{}).frozen?)
378+
assert_equal_not_same(kw, o.yo(**kw))
379+
assert_equal_not_same(h, o.yo(**h))
380+
assert_equal(false, o.send(:yo, **{}).frozen?)
381+
assert_equal_not_same(kw, o.send(:yo, **kw))
382+
assert_equal_not_same(h, o.send(:yo, **h))
383+
assert_equal(false, o.public_send(:yo, **{}).frozen?)
384+
assert_equal_not_same(kw, o.public_send(:yo, **kw))
385+
assert_equal_not_same(h, o.public_send(:yo, **h))
386386
assert_equal(false, m.(**{}).frozen?)
387387
assert_equal_not_same(kw, m.(**kw))
388388
assert_equal_not_same(h, m.(**h))
389389
assert_equal(false, m.send(:call, **{}).frozen?)
390390
assert_equal_not_same(kw, m.send(:call, **kw))
391391
assert_equal_not_same(h, m.send(:call, **h))
392392

393-
o.singleton_class.send(:remove_method, :y)
394-
def o.y(**kw) super(**kw) end
395-
assert_equal(false, o.y(**{}).frozen?)
396-
assert_equal_not_same(kw, o.y(**kw))
397-
assert_equal_not_same(h, o.y(**h))
398-
assert_equal(false, o.send(:y, **{}).frozen?)
399-
assert_equal_not_same(kw, o.send(:y, **kw))
400-
assert_equal_not_same(h, o.send(:y, **h))
401-
assert_equal(false, o.public_send(:y, **{}).frozen?)
402-
assert_equal_not_same(kw, o.public_send(:y, **kw))
403-
assert_equal_not_same(h, o.public_send(:y, **h))
393+
o.singleton_class.send(:remove_method, :yo)
394+
def o.yo(**kw) super(**kw) end
395+
assert_equal(false, o.yo(**{}).frozen?)
396+
assert_equal_not_same(kw, o.yo(**kw))
397+
assert_equal_not_same(h, o.yo(**h))
398+
assert_equal(false, o.send(:yo, **{}).frozen?)
399+
assert_equal_not_same(kw, o.send(:yo, **kw))
400+
assert_equal_not_same(h, o.send(:yo, **h))
401+
assert_equal(false, o.public_send(:yo, **{}).frozen?)
402+
assert_equal_not_same(kw, o.public_send(:yo, **kw))
403+
assert_equal_not_same(h, o.public_send(:yo, **h))
404404
assert_equal(false, m.(**{}).frozen?)
405405
assert_equal_not_same(kw, m.(**kw))
406406
assert_equal_not_same(h, m.(**h))
@@ -436,17 +436,17 @@ def initialize(**kw) @kw = kw end
436436
assert_equal_not_same(h, m.(**h))
437437
assert_equal_not_same(h, m.send(:call, **h))
438438

439-
singleton_class.send(:remove_method, :y)
439+
singleton_class.send(:remove_method, :yo)
440440
def self.method_missing(_, **kw) kw end
441-
assert_equal(false, y(**{}).frozen?)
442-
assert_equal_not_same(kw, y(**kw))
443-
assert_equal_not_same(h, y(**h))
444-
assert_equal(false, send(:y, **{}).frozen?)
445-
assert_equal_not_same(kw, send(:y, **kw))
446-
assert_equal_not_same(h, send(:y, **h))
447-
assert_equal(false, public_send(:y, **{}).frozen?)
448-
assert_equal_not_same(kw, public_send(:y, **kw))
449-
assert_equal_not_same(h, public_send(:y, **h))
441+
assert_equal(false, yo(**{}).frozen?)
442+
assert_equal_not_same(kw, yo(**kw))
443+
assert_equal_not_same(h, yo(**h))
444+
assert_equal(false, send(:yo, **{}).frozen?)
445+
assert_equal_not_same(kw, send(:yo, **kw))
446+
assert_equal_not_same(h, send(:yo, **h))
447+
assert_equal(false, public_send(:yo, **{}).frozen?)
448+
assert_equal_not_same(kw, public_send(:yo, **kw))
449+
assert_equal_not_same(h, public_send(:yo, **h))
450450
end
451451

452452
def test_regular_kwsplat

0 commit comments

Comments
 (0)