diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-12-20 19:41:15 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-12-20 19:41:15 +0900 |
commit | f7aee584987e24768670e96b1455ed1193f91ef2 (patch) | |
tree | 6f6465e61af7bc2581abdaad09ac8e5786975d6a /test/-ext- | |
parent | 2b2030f265e4ec0782de9c8dd9f8828a1a0af1b5 (diff) | |
download | ruby-f7aee584987e24768670e96b1455ed1193f91ef2.tar.gz |
vm_args.c: rephrase the warning message of keyword argument separation
(old)
test.rb:4: warning: The last argument is used as the keyword parameter
test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call?
(new)
test.rb:4: warning: The last argument is used as keyword parameters; maybe ** should be added to the call
test.rb:1: warning: The called method `foo' is defined here
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/funcall/test_passing_block.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/-ext-/funcall/test_passing_block.rb b/test/-ext-/funcall/test_passing_block.rb index c2d7639b52..dd67b7c7de 100644 --- a/test/-ext-/funcall/test_passing_block.rb +++ b/test/-ext-/funcall/test_passing_block.rb @@ -29,7 +29,7 @@ class TestFuncall < Test::Unit::TestCase assert_equal([[{}], {}], Relay.with_funcall_passing_block_kw(2, {}, **{}, &block)) assert_equal([[], {a: 1}], Relay.with_funcall_passing_block_kw(3, a: 1, &block)) assert_equal([[{a: 1}], {}], Relay.with_funcall_passing_block_kw(3, {a: 1}, **{}, &block)) - assert_warn(/warning: The keyword argument is passed as the last hash parameter.*for method/m) do + assert_warn(/warning: The keyword argument is passed as the last hash parameter.*The called method is defined here/m) do assert_equal({}, Relay.with_funcall_passing_block_kw(3, **{}, &->(a){a})) end end @@ -53,7 +53,7 @@ class TestFuncall < Test::Unit::TestCase assert_equal([[], {a: 1}], Relay.with_funcallv_public_kw(o, :foo, 3, a: 1)) assert_equal([[{a: 1}], {}], Relay.with_funcallv_public_kw(o, :foo, 3, {a: 1}, **{})) assert_raise(NoMethodError) { Relay.with_funcallv_public_kw(o, :bar, 3, {a: 1}, **{}) } - assert_warn(/warning: The keyword argument is passed as the last hash parameter.*for `baz'/m) do + assert_warn(/warning: The keyword argument is passed as the last hash parameter.*The called method `baz'/m) do assert_equal({}, Relay.with_funcallv_public_kw(o, :baz, 3, **{})) end end @@ -64,7 +64,7 @@ class TestFuncall < Test::Unit::TestCase assert_equal([[], {a: 1}], Relay.with_yield_splat_kw(1, [{a: 1}], &block)) assert_equal([[1], {a: 1}], Relay.with_yield_splat_kw(1, [1, {a: 1}], &block)) assert_equal([[{}], {}], Relay.with_yield_splat_kw(2, [{}], **{}, &block)) - assert_warn(/warning: The last argument is used as the keyword parameter.*for method/m) do + assert_warn(/warning: The last argument is used as keyword parameters.*The called method is defined here/m) do assert_equal([[], {a: 1}], Relay.with_yield_splat_kw(3, [{a: 1}], &block)) end assert_equal([[{a: 1}], {}], Relay.with_yield_splat_kw(3, [{a: 1}], **{}, &block)) |