summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-10-04The same warning for static symbol literalNobuyoshi Nakada
2021-10-04Fix the warning message for dynamic symbol literal in conditionNobuyoshi Nakada
2021-10-03Remove extraneous conversion to float [Bug #18236]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4927
2021-10-03[ruby/reline] Re-calc the scroll pos when the content in dialog is shortenedaycabta
https://github.com/ruby/reline/commit/12ea63e6e0
2021-10-03Revert "mkmf.rb: try linking at try_var" [Bug #18235]Nobuyoshi Nakada
This reverts commit 524513be399e81bb170ec88aa0d501f33cbde8c3, which can return false positive by existing but unusable symbol, including functions.
2021-10-03[ruby/reline] Add a test for rerendering arg prompt after pastingaycabta
https://github.com/ruby/reline/commit/5414a42b0e
2021-10-03[ruby/reline] Add newlines for readabilityaycabta
https://github.com/ruby/reline/commit/2a60aacebb
2021-10-03[ruby/reline] Stop using Ctrl+j to test on Windowsaycabta
Because Ctrl+j and Enter are the same on Windows. https://github.com/ruby/reline/commit/fa885ed449
2021-10-02Temporarily skip test_no_curdir test to avoid CI failures on SolarisJeremy Evans
2021-10-02Do not load file with same realpath twice when requiringJeremy Evans
This fixes issues with paths being loaded twice in certain cases when symlinks are used. It took me multiple attempts to get this working. My original attempt tried to convert paths to realpaths before adding them to $LOADED_FEATURES. Unfortunately, this doesn't work well with the loaded feature index, which is based off load paths and not realpaths. While I was able to get require working, I'm fairly sure the loaded feature index was not being used as expected, which would have significant performance implications. Additionally, I was never able to get that approach working with autoload when autoloading a non-realpath file. It also broke some specs. This takes a more conservative approach. Directly before loading the file, if the file with the same realpath has been required, the loading of the file is skipped. The realpaths are stored as fstrings in a hidden hash. When rebuilding the loaded feature index, the hash of realpaths is also rebuilt. I'm guessing this makes rebuilding process slower, but I don think that is a hot path. In general, modifying loaded features is only done when reloading, and that tends to be in non-production environments. Change test_require_with_loaded_features_pop test to use 30 threads and 300 iterations, instead of 4 threads and 1000 iterations. I saw only sporadic failures with 4/1000, but consistent failures 30/300 threads. These failures were due to the fact that the concurrent deletions from $LOADED_FEATURES in other threads can result in rb_ary_entry returning nil when rebuilding the loaded features index. To avoid concurrency issues when rebuilding the loaded features index, the building of the index itself is left alone, and afterwards, a separate loop is done on a copy of the loaded feature snapshot in order to rebuild the realpaths hash. Fixes [Bug #17885] Notes: Merged: https://github.com/ruby/ruby/pull/4887
2021-10-02[ruby/reline] Refactoring Reline::Key.match? and add test.manga_osyo
https://github.com/ruby/reline/commit/90e8999ae4
2021-10-01Avoid race condition in Regexp#matchJeremy Evans
In certain conditions, Regexp#match could return a MatchData with missing captures. This seems to require at the least, multiple threads calling a method that calls the same block/proc/lambda which calls Regexp#match. The race condition happens because the MatchData is passed from indirectly via the backref, and other threads can modify the backref. Fix the issue by: 1. Not reusing the existing MatchData from the backref, and always allocating a new MatchData. 2. Passing the MatchData directly to the caller using a VALUE*, instead of indirectly through the backref. It's likely that variants of this issue exist for other Regexp methods. Anywhere that MatchData is passed implicitly through the backref is probably vulnerable to this issue. Fixes [Bug #17507] Notes: Merged: https://github.com/ruby/ruby/pull/4734
2021-10-02Restore Hash#compare_by_identity mode [Bug #18171]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4893
2021-10-01Fix the encoding of loaded feature names [Bug #18191]Nobuyoshi Nakada
The feature names loaded from the default load paths should also be in the file system encoding. Notes: Merged: https://github.com/ruby/ruby/pull/4915
2021-09-30Make Array#min/max optimization respect refined methodsJeremy Evans
Pass in ec to vm_opt_newarray_{max,min}. Avoids having to call GET_EC inside the functions, for better performance. While here, add a test for Array#min/max being redefined to test_optimization.rb. Fixes [Bug #18180] Notes: Merged: https://github.com/ruby/ruby/pull/4911 Merged-By: jeremyevans <code@jeremyevans.net>
2021-09-30marshal.c: don't call the proc with partially initialized objects. (#4866)Jean byroot Boussier
For cyclic objects, it requires to keep a st_table of the partially initialized objects. Notes: Merged-By: byroot <jean.boussier@gmail.com>
2021-09-29[ruby/reline] Support ed_argument_digit by M+numaycabta
The vi mode can handle "argument number" before an operator or a motion, such as, "3x" (equals "xxx"), and "3l" (equals "lll"). In the emacs mode, GNU Readline can handle argument number with meta key, like "Meta+3 x" (equals "xxx"). https://github.com/ruby/reline/commit/9183cc2e8b
2021-09-28[ruby/did_you_mean] Disable error_highlight when testing did_you_meanYusuke Endoh
Fixes #160 https://github.com/ruby/did_you_mean/commit/93df310873
2021-09-28[rubygems/rubygems] Only disallow FIXME/TODO for first word of gemspec ↵Ellen Marie Dash
description 7890c98 matched the start of each line, whereas this matches the start of the entire string. https://github.com/rubygems/rubygems/commit/432de7b819
2021-09-28[ruby/date] Make %v strftime flag use uppercase monthJeremy Evans
%v is supposed to be the VMS date, and VMS date format uses an uppercase month. Ruby 1.8 used an uppercase month for %v, but the behavior was changed without explanation in r31672. Time#strftime still uses an uppercase month for %v, so this change makes Date#strftime consistent with Time#strftime. Fixes [Bug #13810] https://github.com/ruby/date/commit/56c489fd7e
2021-09-28[ruby/drb] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/drb/commit/0da149e7a9
2021-09-28[ruby/ostruct] Allow properties to be accessed even when the object is moved ↵rm155
to another Ractor (https://github.com/ruby/ostruct/pull/29) https://github.com/ruby/ostruct/commit/d85639f2f5
2021-09-28[ruby/reline] Ignore NUL by ed_quoted_insertaycabta
https://github.com/ruby/reline/commit/43b7c01a98
2021-09-28[ruby/timeout] test that yield is given number of secondsJohn Bachir
https://github.com/ruby/timeout/commit/ec5a614334
2021-09-27Show failed environment variablesNobuyoshi Nakada
2021-09-27[ruby/timeout] test for basic functionalityJohn Bachir
https://github.com/ruby/timeout/commit/1c6bb90aea
2021-09-24Pend test_complete_require_library_name_firstaycabta
2021-09-24[rubygems/rubygems] Use pend instead of skip in the absence of git in test ↵Lucas Kanashiro
helper https://github.com/rubygems/rubygems/commit/798a93a98c
2021-09-24[rubygems/rubygems] Fix error message building changing password of sourcehuangduirong
Do not change the password of the input parameter source during anonymization, by using the proper helper instead of changing the original uri directly. https://github.com/rubygems/rubygems/commit/eaa2dd8a97
2021-09-24Use the flag for uninitialized module [Bug #18185]Nobuyoshi Nakada
Make `Module#ancestors` not to include `BasicObject`. Notes: Merged: https://github.com/ruby/ruby/pull/4883
2021-09-24Consider modified modules initialized [Bug #18185]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4883
2021-09-23Revive the test using US-ASCII incompatible symbolNobuyoshi Nakada
2021-09-23[ruby/irb] Ignore any encoding errors while symbol completionNobuyoshi Nakada
https://github.com/ruby/irb/commit/daa65cded1
2021-09-23Prohibit invalid encoding symbols [Bug #18184]Nobuyoshi Nakada
2021-09-23Check the encoding of `ruby2_keywords_flag` [Bug #18184]Nobuyoshi Nakada
2021-09-22[ruby/irb] Use typed spaces when the line is inside the here documentsKaíque Kandy Koga
Use first method instead of square brackets to support 2.5 and 2.6 versions Use tokens Clear check_newline_depth_difference https://github.com/ruby/irb/commit/6fec2a5d46
2021-09-22Check the entire name as `ruby2_keywords_flag` [Bug #18184]Nobuyoshi Nakada
2021-09-22[rubygems/rubygems] Fix bug where redacted credentials are sent to serverJonathan
Implement deep cloning for `Gem::Uri` class to fix a bug where redacting credentials modifies the URI string in place instead of returning a modified copy. https://github.com/rubygems/rubygems/commit/eafb5a279b
2021-09-22[rubygems/rubygems] Update gem request tests to pass a Gem::Uri into the ↵Jonathan
Gem::Request class https://github.com/rubygems/rubygems/commit/e8e7c2078f
2021-09-22[rubygems/rubygems] Only check if descriptions *start with* FIXME/TODOEllen Marie Dash
It doesn't make much sense to just forbid certain words in descriptions. https://github.com/rubygems/rubygems/commit/7890c98415
2021-09-21[ruby/irb] Fix argument orderNobuyoshi Nakada
https://github.com/ruby/irb/commit/05c65858a0
2021-09-20Add alternative optional hook for `scheduler_close` to allow public usage of ↵Samuel Williams
close. Notes: Merged: https://github.com/ruby/ruby/pull/4658
2021-09-20Allow to include uninitialized modules [Bug #18177]Nobuyoshi Nakada
The module that is about to be included is considered initialized. Notes: Merged: https://github.com/ruby/ruby/pull/4868
2021-09-20MINGW-UCRT: Set CONFIG['arch'] and RUBY_PLATFORM to "x64-mingw-ucrt"Lars Kanis
This allows easy differentiation between ABI incompatible platforms like MSWIN64 and MSVCRT-based MINGW32. This also implicates a distinct rubygem platform which is also "x64-mingw-ucrt". Although the term "mingw32" is the OS-part for 64 bit systems as well, the "32" is misleading and confusing for many users. Therefore the new platform string drops the "32" from the OS part to just "mingw". This conforms to the common practice of windows platform testing per RUBY_PLATFORM=~/mswin|mingw/ . Notes: Merged: https://github.com/ruby/ruby/pull/4599
2021-09-20Adjust test to set+get big values on all platforms and add MINGW-UCRTLars Kanis
Previously the test verified on MSWIN that huge values can not be stored in environment variables but that they can on others. IMHO the intention of the test should not change between platforms. Therefore this adjusts the test to have the same intention - that is to store a big value. This also fixes compatibility with MINGW-UCRT, which previously failed with: <Errno::EINVAL: Invalid argument - ruby_setenv(foo)> test/ruby/test_env.rb:512:in `[]=' test/ruby/test_env.rb:512:in `block in test_huge_value' Notes: Merged: https://github.com/ruby/ruby/pull/4599
2021-09-18Revert "Do not load file with same realpath twice when requiring"Jeremy Evans
This reverts commit ddb85c5d2bdf75a83eb163856508691a7436b446. This commit causes unexpected warnings in TestTranscode#test_loading_race occasionally in CI.
2021-09-18Do not load file with same realpath twice when requiringJeremy Evans
This fixes issues with paths being loaded twice in certain cases when symlinks are used. It took me multiple attempts to get this working. My original attempt tried to convert paths to realpaths before adding them to $LOADED_FEATURES. Unfortunately, this doesn't work well with the loaded feature index, which is based off load paths and not realpaths. While I was able to get require working, I'm fairly sure the loaded feature index was not being used as expected, which would have significant performance implications. Additionally, I was never able to get that approach working with autoload when autoloading a non-realpath file. It also broke some specs. This takes a more conservative approach. Directly before loading the file, if the file with the same realpath has been required, the loading of the file is skipped. The realpaths are stored as fstrings in a hidden hash. When rebuilding the loaded feature index, the hash of realpaths is also rebuilt. I'm guessing this makes rebuilding process slower, but I don think that is a hot path. In general, modifying loaded features is only done when reloading, and that tends to be in non-production environments. Change test_require_with_loaded_features_pop test to use 30 threads and 300 iterations, instead of 4 threads and 1000 iterations. I saw only sporadic failures with 4/1000, but consistent failures 30/300 threads. These failures were due to the fact that the concurrent deletions from $LOADED_FEATURES in other threads can result in rb_ary_entry returning nil when rebuilding the loaded features index. To avoid concurrency issues when rebuilding the loaded features index, the building of the index itself is left alone, and afterwards, a separate loop is done on a copy of the loaded feature snapshot in order to rebuild the realpaths hash. Fixes [Bug #17885] Notes: Merged: https://github.com/ruby/ruby/pull/4615
2021-09-18ast.c: AST.of against C method should return nil (as Ruby 2.6--3.0)Yusuke Endoh
2021-09-18ast.c: AST.of checks if a given method object is defined in CYusuke Endoh
[Bug #18178]
2021-09-17Removed Module.allocate [Bug #17048]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4858