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
This commit is contained in:
Yusuke Endoh 2019-12-20 19:41:15 +09:00
parent 2b2030f265
commit f7aee58498
12 changed files with 357 additions and 357 deletions

View file

@ -1208,8 +1208,8 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
assert_raise(ArgumentError) {warn("test warning", uplevel: -1)}
assert_in_out_err(["-e", "warn 'ok', uplevel: 1"], '', [], /warning:/)
warning = capture_warning_warn {warn("test warning", {uplevel: 0})}
assert_equal("#{__FILE__}:#{__LINE__-1}: warning: The last argument is used as the keyword parameter\n", warning[0])
assert_match(/warning: for method defined here|warning: test warning/, warning[1])
assert_equal("#{__FILE__}:#{__LINE__-1}: warning: The last argument is used as keyword parameters; maybe ** should be added to the call\n", warning[0])
assert_match(/warning: The called method (?:`.*' )?is defined here|warning: test warning/, warning[1])
warning = capture_warning_warn {warn("test warning", **{uplevel: 0})}
assert_equal("#{__FILE__}:#{__LINE__-1}: warning: test warning\n", warning[0])
warning = capture_warning_warn {warn("test warning", {uplevel: 0}, **{})}