Skip to content

Commit 691a554

Browse files
etiennebarriebyroot
authored andcommitted
Restore test example for argument forwarding
Since cb419e3 we're no longer testing this case because foo is redefined on obj1.
1 parent 8a30594 commit 691a554

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/ruby/test_syntax.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,10 +2027,11 @@ def obj1.bar(*args, **kws, &block)
20272027
end
20282028
obj4 = obj1.clone
20292029
obj5 = obj1.clone
2030+
obj6 = obj1.clone
20302031
obj1.instance_eval('def foo(...) bar(...) end', __FILE__, __LINE__)
2031-
obj1.instance_eval('def foo(...) eval("bar(...)") end', __FILE__, __LINE__)
20322032
obj4.instance_eval("def foo ...\n bar(...)\n""end", __FILE__, __LINE__)
20332033
obj5.instance_eval("def foo ...; bar(...); end", __FILE__, __LINE__)
2034+
obj6.instance_eval('def foo(...) eval("bar(...)") end', __FILE__, __LINE__)
20342035

20352036
klass = Class.new {
20362037
def foo(*args, **kws, &block)
@@ -2059,7 +2060,7 @@ def obj3.bar(*args, &block)
20592060
end
20602061
obj3.instance_eval('def foo(...) bar(...) end', __FILE__, __LINE__)
20612062

2062-
[obj1, obj2, obj3, obj4, obj5].each do |obj|
2063+
[obj1, obj2, obj3, obj4, obj5, obj6].each do |obj|
20632064
assert_warning('') {
20642065
assert_equal([[1, 2, 3], {k1: 4, k2: 5}], obj.foo(1, 2, 3, k1: 4, k2: 5) {|*x| x})
20652066
}

0 commit comments

Comments
 (0)