From 0011652a2875de7ea6979e16417514098fb71d89 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 8 Oct 2019 18:49:09 +0900 Subject: Support new numbered parameter syntax `_1` instead of `@1`. --- test/t/syntax.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/t/syntax.rb b/test/t/syntax.rb index 1dca8fd24..af63fcef9 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -674,9 +674,9 @@ end assert('numbered parameters') do - assert_equal(15, [1,2,3,4,5].reduce {@1+@2}) - assert_equal(3, ->{@1+@2}.call(1,2)) - assert_equal(4, ->(a=->{@1}){a}.call.call(4)) - assert_equal(5, -> a: ->{@1} {a}.call.call(5)) - assert_equal(55, Proc.new do @1 + @2 + @3 + @4 + @5 + @6 + @7 + @8 + @9 + @10 end.call(*[1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) + assert_equal(15, [1,2,3,4,5].reduce {_1+_2}) + assert_equal(3, ->{_1+_2}.call(1,2)) + assert_equal(4, ->(a=->{_1}){a}.call.call(4)) + assert_equal(5, -> a: ->{_1} {a}.call.call(5)) + assert_equal(45, Proc.new do _1 + _2 + _3 + _4 + _5 + _6 + _7 + _8 + _9 end.call(*[1, 2, 3, 4, 5, 6, 7, 8, 9])) end -- cgit v1.2.3