aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix fallback in URI.encode_www_form_component to include #Jeremy Evans2019-09-271-0/+2
| | | | | | Patch from Matthew Kerwin. Fixes [Bug #14358]
* Do not escape + in Shellwords.escapeJeremy Evans2019-09-271-0/+5
| | | | | | + is not a character that requires escaping in Bourne sh. Fixes [Bug #14429]
* Ignore Errno::EPIPE when sending requests in net/httpJeremy Evans2019-09-271-0/+11
| | | | | | | | An EPIPE when sending the request should be ignored. Even if you cannot write more data, you may still be able to read the server's response. Fixes [Bug #14466]
* Drop eliminated catch-entriesNobuyoshi Nakada2019-09-271-0/+15
| | | | | Drop catch table entries used in eliminated block, as well as call_infos. [Bug #16184]
* More tests for [Feature #16150]Nobuyoshi Nakada2019-09-271-0/+21
|
* [ruby/fileutils] Fix test_cp_r_dev on Windows or other systems without ↵Jeremy Evans2019-09-271-4/+4
| | | | | | | | | | | | | character/block device in /dev Previously this would give an error such as: TestFileUtils#test_cp_r_dev [c:/fileutils/test/fileutils/test_fileutils.rb:455]: [RuntimeError] exception expected, not. Class: <TypeError> Message: <"no implicit conversion of nil into String"> https://github.com/ruby/fileutils/commit/0ce0fefbeb
* [ruby/fileutils] Do not break in verbose mode if using FileUtils with a ↵Jeremy Evans2019-09-271-0/+24
| | | | | | | | | | | | | frozen object If FileUtils is included into another object, and verbose mode is used, a FrozenError is currently raised unless the object has the @fileutils_output and @fileutils_label instance variables. This fixes things so that it does not attempt to set the instance variables, but it still uses them if they are present. https://github.com/ruby/fileutils/commit/689cb9c56a
* [ruby/fileutils] Skip test_cp_r_socket on JRubyJeremy Evans2019-09-271-0/+1
| | | | https://github.com/ruby/fileutils/commit/20bb9ec789
* [ruby/fileutils] Make copy methods handle FIFOs and UNIX socketsJeremy Evans2019-09-271-0/+28
| | | | | | | | | | | | | | | | | | Previously, this was broken. Trying to copy a FIFO would raise a NoMethodError if File.mkfifo was defined. Trying to copy a UNIX socket would raise a RuntimeError as File.mknod is not something Ruby defines. Handle the FIFO issue using File.mkfifo instead of mkfifo. Handle the UNIX Socket issue by creating a unix socket. Continue to not support character or block devices, raising a RuntimeError for both. Add tests for FIFO, UNIX Socket, and character/block devices. https://github.com/ruby/fileutils/commit/123903532d
* Fix more keyword separation issuesJeremy Evans2019-09-262-9/+651
| | | | | | | | | | | | | | | | | | | | | This fixes instance_exec and similar methods. It also fixes Enumerator::Yielder#yield, rb_yield_block, and a couple of cases with Proc#{<<,>>}. This support requires the addition of rb_yield_values_kw, similar to rb_yield_values2, for passing the keyword flag. Unlike earlier attempts at this, this does not modify the rb_block_call_func type or add a separate function type. The functions of type rb_block_call_func are called by Ruby with a separate VM frame, and we can get the keyword flag information from the VM frame flags, so it doesn't need to be passed as a function argument. These changes require the following VM functions accept a keyword flag: * vm_yield_with_cref * vm_yield * vm_yield_with_block
* Add compaction support to `rb_ast_t`Aaron Patterson2019-09-261-0/+14
| | | | This commit adds compaction support to `rb_ast_t`.
* Fix keyword argument separation issues in Enumerator::Generator#eachJeremy Evans2019-09-261-0/+77
| | | | This requires adding rb_proc_call_kw to pass the keyword flag.
* Honor Syslog::Logger#level overridesGeorge Claghorn2019-09-261-0/+15
|
* Kernel#open may be redefinedNobuyoshi Nakada2019-09-271-2/+13
|
* Fix keyword argument separation issues in Fiber#resumeJeremy Evans2019-09-261-0/+77
|
* Fix keyword argument separation issues in Thread.newJeremy Evans2019-09-261-0/+80
|
* Fix more keyword argument separation issues in PathnameJeremy Evans2019-09-261-0/+32
|
* Fix keyword argument separation issues in ↵Jeremy Evans2019-09-261-0/+15
| | | | | | | | | OpenSSL::SSL::SSLSocket#sys{read,write}_nonblock It's unlikely anyone would actually hit these. The methods are private, you only hit this code path if calling these methods before performing the SSL connection, and there is already a verbose warning issued.
* Fix keyword argument separation issues in Proc#{<<,>>}Jeremy Evans2019-09-261-0/+136
| | | | This requires adding rb_proc_call_with_block_kw.
* Fix keyword argument sepration issues when IO#open calls #to_openJeremy Evans2019-09-261-0/+13
|
* Fix Module#name news and add a testJean Boussier2019-09-261-0/+4
|
* Restore ENV, rubygems always sets SOURCE_DATE_EPOCH nowNobuyoshi Nakada2019-09-261-0/+2
|
* Suppress assert_match warnings.Hiroshi SHIBATA2019-09-261-2/+2
|
* Assert warnings message for the last argument is keyword parameter.Hiroshi SHIBATA2019-09-261-2/+2
|
* [rubygems/rubygems] Make sure our modifications to kernel.warn workDavid Rodríguez2019-09-261-0/+15
| | | | | | And test the fix we're adding. https://github.com/rubygems/rubygems/commit/6f86637b98
* [rubygems/rubygems] indentHiroshi SHIBATA2019-09-261-4/+4
| | | | https://github.com/rubygems/rubygems/commit/8cdb2fd66f
* [rubygems/rubygems] Fix test_gem_attrbronzdoc2019-09-261-4/+4
| | | | https://github.com/rubygems/rubygems/commit/7c5b66f9ef
* [rubygems/rubygems] add testsf2019-09-261-0/+1
| | | | https://github.com/rubygems/rubygems/commit/8a7e27381c
* [rubygems/rubygems] Fix underscore version for bundler itselfDavid Rodríguez2019-09-261-0/+34
| | | | | | Previously it wouldn't play nice with the bundler version finder. https://github.com/rubygems/rubygems/commit/d8bb81556d
* [rubygems/rubygems] Update expectation in test_to_ruby_with_rsa_keybronzdoc2019-09-261-2/+1
| | | | https://github.com/rubygems/rubygems/commit/2e65f7d4ae
* [rubygems/rubygems] Make ruby_code method handle OpenSSL::PKey::RSA objectsbronzdoc2019-09-261-0/+30
| | | | https://github.com/rubygems/rubygems/commit/b1d825ab3a
* [rubygems/rubygems] Set SOURCE_DATE_EPOCH env var if not provided.Ellen Marie Dash2019-09-262-0/+59
| | | | | | | | | | | | | Fixes #2290. 1. `Gem::Specification.date` returns SOURCE_DATE_EPOCH when defined, 2. this commit makes RubyGems set it _persistently_ when not provided. This combination means that you can build a gem, check the build time, and use that value to generate a new build -- and then verify they're the same. https://github.com/rubygems/rubygems/commit/d830d53f59
* [rubygems/rubygems] Add a gem attr to the Gem::Package class.Daniel Berger2019-09-261-0/+5
| | | | https://github.com/rubygems/rubygems/commit/5b81f364ae
* [EXPERIMENTAL] Make Symbol#to_s return a frozen StringBenoit Daloze2019-09-261-1/+3
| | | | | | * Always the same frozen String for a given Symbol. * Avoids extra allocations whenever calling Symbol#to_s. * See [Feature #16150]
* RubyVM::MJIT.pause(wait: true) should waitTakashi Kokubun2019-09-262-0/+17
| | | | | | | | | | | for all compilations and compaction. Prior to this commit, the last-compiled code has not been used because MJIT worker is stopped before setting the code, and compaction has also been skipped. But it was not intentional and `wait: true` pause should wait until those two things by its feature.
* Tag string shared roots to fix use-after-freeAlan Wu2019-09-261-0/+9
| | | | | | | | | | | | | | The buffer deduplication codepath in rb_fstring can be used to free the buffer of shared string roots, which leads to use-after-free. Introudce a new flag to tag strings that at one point have been a shared root. Check for it in rb_fstring to avoid freeing buffers that are shared by multiple strings. This change is based on nobu's idea in [ruby-core:94838]. The included test case test for the sequence of calls to internal functions that lead to this bug. See attached ticket for Ruby level repros. [Bug #16151]
* [EXPERIMENTAL] Expression with modifier `in`Nobuyoshi Nakada2019-09-262-1/+8
| | | | [Feature #15865]
* Add Module#ruby2_keywords for passing keywords through regular argument splatsJeremy Evans2019-09-252-0/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans2019-09-2511-56/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cfuncs that use rb_scan_args with the : entry suffer similar keyword argument separation issues that Ruby methods suffer if the cfuncs accept optional or variable arguments. This makes the following changes to : handling. * Treats as **kw, prompting keyword argument separation warnings if called with a positional hash. * Do not look for an option hash if empty keywords are provided. For backwards compatibility, treat an empty keyword splat as a empty mandatory positional hash argument, but emit a a warning, as this behavior will be removed in Ruby 3. The argument number check needs to be moved lower so it can correctly handle an empty positional argument being added. * If the last argument is nil and it is necessary to treat it as an option hash in order to make sure all arguments are processed, continue to treat the last argument as the option hash. Emit a warning in this case, as this behavior will be removed in Ruby 3. * If splitting the keyword hash into two hashes, issue a warning, as we will not be splitting hashes in Ruby 3. * If the keyword argument is required to fill a mandatory positional argument, continue to do so, but emit a warning as this behavior will be going away in Ruby 3. * If keyword arguments are provided and the last argument is not a hash, that indicates something wrong. This can happen if a cfunc is calling rb_scan_args multiple times, and providing arguments that were not passed to it from Ruby. Callers need to switch to the new rb_scan_args_kw function, which allows passing of whether keywords were provided. This commit fixes all warnings caused by the changes above. It switches some function calls to *_kw versions with appropriate kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS is used. If creating new arguments, RB_PASS_KEYWORDS is used if the last argument is a hash to be treated as keywords. In open_key_args in io.c, use rb_scan_args_kw. In this case, the arguments provided come from another C function, not Ruby. The last argument may or may not be a hash, so we can't set keyword argument mode. However, if it is a hash, we don't want to warn when treating it as keywords. In Ruby files, make sure to appropriately use keyword splats or literal keywords when calling Cfuncs that now issue keyword argument separation warnings through rb_scan_args. Also, make sure not to pass nil in place of an option hash. Work around Kernel#warn warnings due to problems in the Rubygems override of the method. There is an open pull request to fix these issues in Rubygems, but part of the Rubygems tests for their override fail on ruby-head due to rb_scan_args not recognizing empty keyword splats, which this commit fixes. Implementation wise, adding rb_scan_args_kw is kind of a pain, because rb_scan_args takes a variable number of arguments. In order to not duplicate all the code, the function internals need to be split into two functions taking a va_list, and to avoid passing in a ton of arguments, a single struct argument is used to handle the variables previously local to the function.
* Removed idNUMPARAM_0Nobuyoshi Nakada2019-09-251-1/+0
|
* Changed numbered parameters semanticsNobuyoshi Nakada2019-09-251-11/+1
| | | | | | | * `_1` (and no other numbered parameters) to work as `|x|`. * giving up `_0`. [ruby-core:95074] [Bug #16178]
* Revert "[ruby/io-console] Skip cursor position test on Solaris"Kazuhiro NISHIYAMA2019-09-251-1/+0
| | | | This reverts commit 5294ded681992ced2ecbd31c814b63265d2f591e.
* [ruby/io-console] Unique paths to be addedNobuyoshi Nakada2019-09-251-0/+1
| | | | https://github.com/ruby/io-console/commit/a3ad851b6c
* [ruby/io-console] Load the current librariesNobuyoshi Nakada2019-09-251-1/+3
| | | | https://github.com/ruby/io-console/commit/ab7653c543
* [ruby/io-console] Skip cursor position test on SolarisNobuyoshi Nakada2019-09-251-0/+1
| | | | | | It results in a mysterious failure. https://github.com/ruby/io-console/commit/e3543c3da4
* Make numbered parameters exclusive in a scopeNobuyoshi Nakada2019-09-241-0/+8
|
* Changed numbered parameter prefixNobuyoshi Nakada2019-09-245-38/+32
|
* [ruby/io-console] Made cursor position 0-originNobuyoshi Nakada2019-09-241-0/+20
| | | | https://github.com/ruby/io-console/commit/9377e37295
* Make public_send and rb_f_send handle keyword argument separationJeremy Evans2019-09-231-0/+102
| | | | | Kernel#send takes a different optimized code path that was already handled.
* test/bigdecimal/test_bigdecimal.rb: Use BigDecimal()Yusuke Endoh2019-09-221-1/+1
| | | | instead of deprecated BigDecimal.new.