mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
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:
parent
2b2030f265
commit
f7aee58498
12 changed files with 357 additions and 357 deletions
|
@ -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}, **{})}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue