aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix method name escaping in ObjectSpace.dumpJohn Hawthorn2020-08-171-0/+18
| | | | | | | | It's possible to define methods with any name, even if the parser doesn't support it and it can only be used with ex. send. This fixes an issue where invalid JSON was output from ObjectSpace.dump when a method name needed escaping.
* Ensure the shortcut cached in the classNobuyoshi Nakada2020-08-171-0/+11
| | | | | | As well as the other places using RCLASS_IV_INDEX_TBL. `IO#reopen` seems the only case that the class of an object can be changed.
* Also escape DEL codeNobuyoshi Nakada2020-08-171-0/+1
|
* Fixed the radix for control charsNobuyoshi Nakada2020-08-171-0/+4
|
* Expose ec -> backtrace (internal) and use it to implement fiber backtrace.Samuel Williams2020-08-181-0/+22
| | | | See <https://bugs.ruby-lang.org/issues/16815> for more details.
* Remove the deprecated override of Kernel#open in open-uriJeremy Evans2020-08-161-12/+0
| | | | This was deprecated in 2.7 to resolve [Misc #15893].
* rb_str_{index,rindex}_m: Handle /\K/ in patternKasumi Hanazuki2020-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | When the pattern Regexp given to String#index and String#rindex contain a /\K/ (lookbehind) operator, these methods return the position where the beginning of the lookbehind pattern matches, while they are expected to return the position where the \K matches. ``` # without patch "abcdbce".index(/b\Kc/) # => 1 "abcdbce".rindex(/b\Kc/) # => 4 ``` This patch fixes this problem by using BEG(0) instead of the return value of rb_reg_search. ``` # with patch "abcdbce".index(/b\Kc/) # => 2 "abcdbce".rindex(/b\Kc/) # => 5 ``` Fixes [Bug #17118]
* rb_str_{partition,rpartition}_m: Handle /\K/ in patternKasumi Hanazuki2020-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the pattern given to String#partition and String#rpartition contain a /\K/ (lookbehind) operator, the methods return strings sliced at incorrect positions. ``` # without patch "abcdbce".partition(/b\Kc/) # => ["a", "c", "cdbce"] "abcdbce".rpartition(/b\Kc/) # => ["abcd", "c", "ce"] ``` This patch fixes the problem by using BEG(0) instead of the return value of rb_reg_search. ``` # with patch "abcdbce".partition(/b\Kc/) # => ["ab", "c", "dbce"] "abcdbce".rpartition(/b\Kc/) # => ["abcdb", "c", "e"] ``` As a side-effect this patch makes String#partition 2x faster when the pattern is a costly Regexp by performing Regexp search only once, which was unexpectedly done twice in the original implementation. Fixes [Bug #17119]
* Fix corruption in ARGF.inplacePeter Zhu2020-08-121-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Extension string stored in `ARGF.inplace` is created using an api designed for C string constants to create a Ruby string that points at another Ruby string. When the original string is swept, the extension string gets corrupted. Reproduction script (on MacOS): ```ruby #!/usr/bin/ruby -pi.bak BEGIN { GC.start(full_mark: true) arr = [] 1000000.times do |x| arr << "fooo#{x}" end } puts "hello" ``` Co-Authored-By: Matt Valentine-House <31869+eightbitraptor@users.noreply.github.com>
* string.c(rb_str_split_m): Handle /\K/ correctlyKasumi Hanazuki2020-08-121-0/+5
| | | | | | | Use BEG(0) instead of the result of rb_reg_search to handle the cases when the separator Regexp contains /\K/ (lookbehind) operator. Fixes [Bug #17113]
* Test out fix for OpenSSL test flakinessAlan Wu2020-08-111-1/+1
| | | | | | | | | | | | | | | | | | `OpenSSL::TestX509Store#test_verify` has been failing intermittently on CI about once a day: - http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/3121244 - http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3117661 - http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3111684 According to the test: > OpenSSL uses time(2) while Time.now uses clock_gettime(CLOCK_REALTIME), > and there may be difference. This difference is could be the cause for the flaky failures. Let's see if giving the certificate more room solves the problem. In any case, I will revert this in a week. I think changes to these should go to https://github.com/ruby/openssl/?
* Enable s390x invokebuiltin JIT test againTakashi Kokubun2020-08-111-1/+0
|
* Add more debug info to test_verifyKazuhiro NISHIYAMA2020-08-071-1/+1
| | | | http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3111684
* Add verbose message to random failed assertionKazuhiro NISHIYAMA2020-08-061-1/+1
| | | | | | for example: http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3111251 http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/3109195
* [Feature #16513] TracePoint#inspect returns "... file:line" (#3391)Nguyễn Quang Minh2020-08-061-2/+2
| | | | | | | | | * Fix debug documents to match Thread#to_s change (Feature #16412 ticket) * TracePoint#inspect returns "... file:line" (Feature #16513) * Guard older version of Ruby in Tracepoint inspection tests * Focus on current thread only when running TracePoint inspection test
* Apply timeout-scale to test_thr_kill.Jun Aruga2020-08-061-1/+1
|
* [ruby/net-http] Fix SSL session reuse test with LibreSSL 3.2+Jeremy Evans2020-08-031-0/+8
| | | | https://github.com/ruby/net-http/commit/5ae9620fbc
* [ruby/net-http] Switch invalid server name formatJeremy Evans2020-08-031-5/+5
| | | | | | | | | | | | | | | | invalid_servername is not a valid name in an SSL request due to the use of the underscore, and LibreSSL 3.2.0 will raise an exception for this. These tests are not testing the allowed characters in the server name, but how net/http handles cases where the server name provided does not match the IP address you are trying to connect to, so I think it's better to just modify the tests to use a correct format. While here, fix a typo in a test name, and use better code in the ensure block so the same test doesn't issue both a failure and an error. https://github.com/ruby/net-http/commit/0e8dc91120
* [rubygems/rubygems] Enable `Layout/LeadingEmptyLines` in rubygemsDavid Rodríguez2020-07-311-1/+0
| | | | https://github.com/rubygems/rubygems/commit/9c17f220af
* [rubygems/rubygems] Fix some intermittent test failures on trufflerubyDavid Rodríguez2020-07-311-0/+2
| | | | | | | | | | | | | | | Since they changed their default to not generate documentation on `gem install`, we're getting some intermittent test failures. Can be reproduced with: ``` TRUFFLERUBYOPT="--experimental-options --testing-rubygems" TESTOPTS=--name="/^\(?:TestGemGemRunner#\(?:test_list_succeeds\)\|TestGemCommandsUpdateCommand#\(?:test_handle_options_system\)\)$/ --seed=54277 --verbose" rake ``` Fix it by resetting all permanent CLI options when CLI runner loads configuration. https://github.com/rubygems/rubygems/commit/7d896f4b74
* [rubygems/rubygems] Setup no longer generates formatted executables by defaultDavid Rodríguez2020-07-311-6/+4
| | | | | | Catch up with that change in `gem update --system` tests. https://github.com/rubygems/rubygems/commit/127ba14344
* [rubygems/rubygems] Let more exceptions flowDavid Rodríguez2020-07-311-3/+14
| | | | | | | | | | | | | | | | If any error happens while verifying a package entry, it doesn't mean that the package is corrupt. It could be a bug in rubygems, for example. This in fact happened in CI and the current error doesn't make it easy to troubleshoot the root cause, since it doesn't provide a backtrace. See https://github.com/rubygems/rubygems/pull/3807/checks?check_run_id=862526615. So I propose to let the exception happens. There was something useful about the previous message, which is the file entry where the error happened, so I'm keeping that information in a warning message. https://github.com/rubygems/rubygems/commit/ece87d858f
* [rubygems/rubygems] Install plugins to user directoryNobuyoshi Nakada2020-07-311-0/+22
| | | | | | | | Fixes the `Gem::FilePermissionError` without the privilege. Initialize `@plugins_dir` to the user gem directory, when installing with `--user` option. https://github.com/rubygems/rubygems/commit/21a71ac769
* [rubygems/rubygems] Fix skip messageDavid Rodríguez2020-07-311-1/+1
| | | | https://github.com/rubygems/rubygems/commit/a763e539cd
* [rubygems/rubygems] Make sure tests at least load without opensslDavid Rodríguez2020-07-313-1/+12
| | | | https://github.com/rubygems/rubygems/commit/054d57f74b
* [rubygems/rubygems] Set the expected hash in one stepDavid Rodríguez2020-07-311-5/+4
| | | | https://github.com/rubygems/rubygems/commit/25912ce6c9
* [rubygems/rubygems] Remove unnecessary checkDavid Rodríguez2020-07-311-6/+4
| | | | | | | No check is done for the other expectation and they are completely symmetric as far as I can see. https://github.com/rubygems/rubygems/commit/4de89e0718
* [rubygems/rubygems] https functionality was merged into `net/https`David Rodríguez2020-07-311-1/+1
| | | | https://github.com/rubygems/rubygems/commit/d81ce9e457
* [rubygems/rubygems] Run `test/rubygems/test_bundled_ca.rb` locallyDavid Rodríguez2020-07-311-36/+34
| | | | | | It's not that slow. https://github.com/rubygems/rubygems/commit/9b928a4503
* [rubygems/rubygems] Remove unused TEST_SSL environment variableDavid Rodríguez2020-07-311-1/+1
| | | | https://github.com/rubygems/rubygems/commit/1e2c3cf118
* [rubygems/rubygems] Fix encoding mismatch errors on MinGWNobuyoshi Nakada2020-07-311-2/+2
| | | | | | | | | | | GNU make in MSys is localized to use UTF-8 while Ruby's filesystem encoding is set to OEM CodePage (e.g., CP932 in Japanese Edition), the read output from the make has broken encoding and results in "invalid byte sequence" errors. As `DESTDIR` is set to a US-ASCII 7bit clean string, matching as binary encoding should have no problems. https://github.com/rubygems/rubygems/commit/96a5e7523b
* [rubygems/rubygems] Reword warningbronzdoc2020-07-311-1/+1
| | | | https://github.com/rubygems/rubygems/commit/cbd4abf8cf
* [rubygems/rubygems] Warn on duplicate dependency in a specificationbronzdoc2020-07-311-0/+7
| | | | https://github.com/rubygems/rubygems/commit/af3e5f7883
* [rubygems/rubygems] Support PATH's using `File::ALT_SEPARATOR` in ↵David Rodríguez2020-07-311-0/+10
| | | | | | | | `Gem::Installer` Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com> https://github.com/rubygems/rubygems/commit/710b969b60
* [rubygems/rubygems] Prefer the standard separator on WindowsDavid Rodríguez2020-07-311-2/+2
| | | | | | | | | It seems like the most common case since it requires no tricks on our CI environment. Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com> https://github.com/rubygems/rubygems/commit/751c475574
* [rubygems/rubygems] Deduplicate the requirement operators in memoryJean Boussier2020-07-311-0/+6
| | | | https://github.com/rubygems/rubygems/commit/9963d33cf2
* Stop using deprecated OpenSSL::Digest constantsBart de Water2020-07-314-12/+10
|
* Enforce no empty lines around class body in rubygemsDavid Rodríguez2020-07-31135-306/+0
| | | | To normalize the code style with `bundler`.
* Added NUL-contained casesNobuyoshi Nakada2020-07-311-0/+17
|
* Fix Array#flatten for recursive array when given positive depth [Bug #17092]Marc-Andre Lafortune2020-07-301-3/+11
|
* Add explicitly require for Dir.mktmpdirHiroshi SHIBATA2020-07-301-0/+1
|
* Apply timeout-scale to test_nogvl_poll.Jun Aruga2020-07-301-1/+2
|
* Fix Time#ceil when result should be the same as the receiverJeremy Evans2020-07-281-0/+5
| | | | Fixes [Bug #17025]
* Use https instead of httpKazuhiro NISHIYAMA2020-07-281-2/+2
|
* vm_backtrace.c: let rb_profile_frames show cfunc framesYusuke Endoh2020-07-281-5/+11
| | | | | ... in addition to normal iseq frames. It is sometimes useful to point the bottleneck more precisely.
* Prevent SystemStackError when calling super in module with activated refinementJeremy Evans2020-07-271-0/+31
| | | | | | | | | Without this, if a refinement defines a method that calls super and includes a module with a module that calls super and has a activated refinement at the point super is called, the module method super call will end up calling back into the refinement method, creating a loop. Fixes [Bug #17007]
* Respect visibility in non-array Enumerable#inject [Bug #13592]Nobuyoshi Nakada2020-07-241-0/+56
|
* Fix Time#to_a behavior with timezone [Bug #17046]S.H2020-07-241-0/+6
|
* Suppress "assigned but unused variable" warningsYusuke Endoh2020-07-231-2/+2
|
* Improved Enumerable::Lazy#flat_mapNobuyoshi Nakada2020-07-231-0/+4
| | | | | | | | | | | | | | | | | | | | |compare-ruby|built-ruby| |:-------|-----------:|---------:| |num3 | 96.333k| 160.732k| | | -| 1.67x| |num10 | 96.615k| 159.150k| | | -| 1.65x| |ary2 | 103.836k| 172.787k| | | -| 1.66x| |ary10 | 109.249k| 177.252k| | | -| 1.62x| |ary20 | 106.628k| 177.371k| | | -| 1.66x| |ary50 | 107.135k| 162.282k| | | -| 1.51x| |ary100 | 106.513k| 177.626k| | | -| 1.67x|