1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
Jeremy Evans 3b302ea8c9 Add Module#ruby2_keywords for passing keywords through regular argument splats
This approach uses a flag bit on the final hash object in the regular splat,
as opposed to a previous approach that used a VM frame flag.  The hash flag
approach is less invasive, and handles some cases that the VM frame flag
approach does not, such as saving the argument splat array and splatting it
later:

  ruby2_keywords def foo(*args)
    @args = args
    bar
  end
  def bar
    baz(*@args)
  end
  def baz(*args, **kw)
    [args, kw]
  end
  foo(a:1)    #=> [[], {a: 1}]
  foo({a: 1}, **{}) #=> [[{a: 1}], {}]

  foo({a: 1}) #=> 2.7: [[], {a: 1}] # and warning
  foo({a: 1}) #=> 3.0: [[{a: 1}], {}]

It doesn't handle some cases that the VM frame flag handles, such as when
the final hash object is replaced using Hash#merge, but those cases are
probably less common and are unlikely to properly support keyword
argument separation.

Use ruby2_keywords to handle argument delegation in the delegate library.
2019-09-25 12:33:52 -07:00
..
-ext- Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
base64
benchmark Aliases capture_output to capture_io for test-unit compatiblity. 2019-08-08 17:19:23 +09:00
bigdecimal test/bigdecimal/test_bigdecimal.rb: Use BigDecimal() 2019-09-22 11:55:00 +09:00
cgi change call CGI methods from :: to . 2019-08-04 09:19:30 +09:00
coverage
csv Fix keyword argument warnings in the tests from Class#new 2019-09-06 19:41:23 -07:00
date date_parse.c: avoid copying 2019-08-12 20:41:11 +09:00
dbm
digest
drb test/drb/drbtest.rb: Skip test_06_timeout on Solaris10s 2019-09-02 22:33:27 +09:00
dtrace
erb
etc
excludes Drop unstable Travis osx in favor of GitHub Actions 2019-09-03 01:01:48 +09:00
fiddle Make test-all and test-spec runnable on Android 2019-09-09 20:24:03 +09:00
fileutils Improve same directory detection in FileUtils 2019-08-06 09:01:04 +09:00
gdbm
io Revert "[ruby/io-console] Skip cursor position test on Solaris" 2019-09-25 09:48:44 +09:00
irb Changed numbered parameter prefix 2019-09-24 21:57:54 +09:00
json
lib Automatically detect missing symbols 2019-09-01 16:31:15 +09:00
logger Fix keyword argument warnings in the tests from Class#new 2019-09-06 19:41:23 -07:00
matrix Add abs to Matrix (#2199) 2019-08-21 16:36:39 -04:00
misc
mkmf Fix keyword argument separation warnings in test 2019-08-30 12:39:31 -07:00
monitor
net Add Net::FTP#features and Net::FTP#option 2019-09-02 14:43:51 +09:00
nkf
objspace
open-uri
openssl
optparse
ostruct
pathname Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
psych
racc
rdoc Remove Travis CI workaround 2019-08-17 20:20:04 +09:00
readline Fix use_lib_reline for test/readline 2019-08-27 01:42:41 +09:00
reline Make rb_scan_args handle keywords more similar to Ruby methods (#2460) 2019-09-25 11:18:49 -07:00
resolv
rexml [ruby/rexml] xpath: add missing value conversions for equality and relational expressions 2019-08-04 11:55:55 +09:00
rinda Fix Leaked thread 2019-07-31 17:45:43 +09:00
ripper Removed idNUMPARAM_0 2019-09-25 13:52:53 +09:00
rss
ruby Add Module#ruby2_keywords for passing keywords through regular argument splats 2019-09-25 12:33:52 -07:00
rubygems [rubygems/rubygems] Bump rubocop to 0.74.0 and fix new offenses 2019-09-05 18:48:15 +09:00
sdbm
socket Remove check of ai.protocol 2019-09-10 12:39:49 +09:00
stringio [ruby/stringio] Supported BOM 2019-08-14 11:20:58 +09:00
strscan
syslog
uri Make portable for standalone test-unit gem. 2019-08-19 18:37:22 +09:00
webrick Adjust indent [ci skip] 2019-08-11 00:44:13 +09:00
win32ole
yaml
zlib
runner.rb
test_abbrev.rb
test_delegate.rb Add Module#ruby2_keywords for passing keywords through regular argument splats 2019-09-25 12:33:52 -07:00
test_extlibs.rb
test_find.rb
test_forwardable.rb
test_ipaddr.rb
test_mutex_m.rb
test_observer.rb
test_open3.rb
test_pp.rb
test_prettyprint.rb
test_prime.rb
test_pstore.rb Expand the timeout of test_pstore_files_are_accessed_as_binary_files 2019-08-05 12:52:14 +09:00
test_pty.rb
test_rbconfig.rb
test_securerandom.rb
test_set.rb
test_shellwords.rb
test_singleton.rb
test_syslog.rb
test_tempfile.rb Fix keyword argument warnings in the tests from Class#new 2019-09-06 19:41:23 -07:00
test_time.rb
test_timeout.rb
test_tmpdir.rb
test_tracer.rb
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb
test_win32api.rb