summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2022-05-23[rubygems/rubygems] Support the change of did_you_mean about ↵Yusuke Endoh
Exception#detailed_message I am asking did_you_mean to use Exception#detailed_message to add "Did you mean?" suggestion instead of overriding #message method. https://github.com/ruby/did_you_mean/pull/177 Unfortunately, the change will affect Gem::UnknownCommandError, which excepts did_you_mean to override #message method. This PR absorbs the change of did_you_mean. Gem::CommandManager now calls #detailed_message method to get a message string with "Did you mean?" suggestion from an exception. https://github.com/rubygems/rubygems/commit/8f104228d3
2022-05-23Prevent a warning: `*' interpreted as argument prefixYusuke Endoh
2022-05-20Make the test class naming consistentTakashi Kokubun
forgot to commit this in ead96e7b44b98bef4896d836239345012821f1d2
2022-05-20Rename test_jit to test_mjitTakashi Kokubun
to avoid confusion with YJIT
2022-05-20Rewrite with assert_ractor for multiple ractor environmentHiroshi SHIBATA
2022-05-20Picked the missing test file from ↵Hiroshi SHIBATA
https://github.com/ruby/did_you_mean/commit/8faba54b2d3ec9aa570691775f143801308c5b2f
2022-05-20[ruby/racc] Show diffsNobuyoshi Nakada
https://github.com/ruby/racc/commit/0b679e2f69
2022-05-20[flori/json] Fix parser bug for empty string allocationAndrew Bromwich
When `HAVE_RB_ENC_INTERNED_STR` is enabled it is possible to pass through a null pointer to `rb_enc_interned_str` resulting in a segfault Fixes #495 https://github.com/flori/json/commit/b59368a8c2
2022-05-20[flori/json] Remove unknown keyword arg from DateTime.parseCharles Oliver Nutter
This snuck in while addding tests for the `create_additions` feature. Caught by JRuby when we added the `limit` option to the Date/DateTime parsing methods, which causes this to be rejected as an unknown keyword. https://github.com/flori/json/commit/b1007dff66
2022-05-20Merge RubyGems and Bundler HEADHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/125415593ead9ab69a9f0bb5392c9d7ec61b1f51
2022-05-19YJIT: Add opt_succ (#5919)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-05-19[ruby/timeout] Handle Timeout + fork and add test for itBenoit Daloze
https://github.com/ruby/timeout/commit/4baee63b9b
2022-05-19[ruby/timeout] Reimplement Timeout.timeout with a single thread and a QueueBenoit Daloze
https://github.com/ruby/timeout/commit/2bafc458f1
2022-05-17Restore implicit relationship between `autoload_const` and `autoload_data` ↵Samuel Williams
during GC. (#5911) Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-05-17Delete autoload data from global features after autoload has completed. (#5910)Samuel Williams
* Update naming of critical section assertions macros. * Improved locking for autoload. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-05-12YJIT: Implement getblockparamAaron Patterson
This implements the getblockparam instruction. There are two cases we need to handle depending on whether or not VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM is set in the environment flag. When the modified flag is unset, we need to call rb_vm_bh_to_procval to get a proc from our passed block, save the proc in the environment, and set the modified flag. In the case that the modified flag is set we are able to just use the existing proc in the environment. One quirk of this is that we need to call jit_prepare_routine_call early and ensure we update PC and SP regardless of the branch taken, so that we have a consistent SP offset at the start of the next instruction. We considered using a chain guard to generate these two paths separately, but decided against it because it's very common to see both and the modified case is basically a subset of the instructions in the unmodified case. This includes tests for both getblockparam and getblockparamproxy which was previously missing a test. Notes: Merged: https://github.com/ruby/ruby/pull/5881
2022-05-12[ruby/uri] Improve URI.register_scheme tests and automatically upcase the ↵Benoit Daloze
given scheme * Also add docs and mention current limitations. * For reference, https://stackoverflow.com/a/3641782/388803 mentions the valid characters in schemes. https://github.com/ruby/uri/commit/4346daac75
2022-05-12[ruby/uri] Add URI::Generic#decoded_#{user,password}Jeremy Evans
URI::Generic#{user,password} return the encoded values, which are not that useful if you want to do authentication with them. Automatic decoding by default would break backwards compatibility. Optional automatic decoding via a keyword to URI.parse would require threading the option through at least 3 other methods, and would make semantics confusing (user= takes encoded or unencoded password?) or require more work. Thus, adding this as a separate method seemed the simplest approach. Unfortunately, URI lacks a method for correct decoding. Unlike in www form components, + in earlier parts of the URI such as the userinfo section is treated verbatim and not as an encoded space. Add URI.#{en,de}code_uri_component methods, which are almost the same as URI.#{en,de}code_www_form_component, but without the special SP => + handling. Implements [Feature #9045] https://github.com/ruby/uri/commit/16cfc4e92f
2022-05-11Ruby shovel operator (<<) speedup. (#5896)Noah Gibbs
For string concat, see if compile-time encoding of strings matches. If so, use simple buffer string concat at runtime. Otherwise, use encoding-checking string concat. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-05-10Fix the order of assert_eqaul and remove unused variablesNobuyoshi Nakada
2022-05-09Add basic binary operators (and, or, xor, not) to `IO::Buffer`. (#5893)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-05-09test/fiber/test_scheduler.rb: Remove the test file from $LOADED_FEATURESYusuke Endoh
to prevent the following failure on `make test-all --repeat-count=2` http://ci.rvm.jp/results/trunk-repeat20-asserts@phosphorus-docker/3957774 ``` 1) Error: TestFiberScheduler#test_autoload: NameError: uninitialized constant TestFiberSchedulerAutoload Object.const_get(:TestFiberSchedulerAutoload) ^^^^^^^^^^ ```
2022-05-09Explicit handling of frozen strings in `IO::Buffer#for`. (#5892)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-05-08Use a proper mutex for autoloading features. (#5788)Samuel Williams
Object#autoload implements a custom per-thread "mutex" for blocking threads waiting on autoloading a feature. This causes problems when used with the fiber scheduler. We swap the implementation to use a Ruby mutex which is fiber aware. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-05-03Add a regression test for opt_plus with unknown type (#5878)Maxime Chevalier-Boisvert
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-04-29Prevent a "warning: `*' interpreted as argument prefix"Yusuke Endoh
2022-04-28Add missing write barriers to Array#replaceAlan Wu
Previously it made object references without using write barriers, creating GC inconsistencies. See: http://ci.rvm.jp/results/trunk-gc-asserts@phosphorus-docker/3925529 Notes: Merged: https://github.com/ruby/ruby/pull/5851
2022-04-28Skip test for cargo builderHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28Move testing_ruby_repo into test helperHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28Merge ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3f7d0352e84b29d4a2d4cd93b31e5ebdb5f79cc6 Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28[rubygems/rubygems] Original env is already set by common test setupDavid Rodríguez
https://github.com/rubygems/rubygems/commit/59449557dd Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28[rubygems/rubygems] Fix test errors when `cargo` not presentDavid Rodríguez
Currently our tests try to detect whether `cargo` is installed or not, and if not, set tests that need `cargo` as pending. However, when this happens that test `setup` method is completely skipped, meaning that the `teardown` method will blow up when trying to switch back to the original folder, since it was not set. This commit fixes that. https://github.com/rubygems/rubygems/commit/1e4c1e6492 Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28Merge rubygems master 1e4eda741d732ca1bd7031aef0a16c7348adf7a5Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28[rubygems/rubygems] Add missing `open3` requiresDavid Rodríguez
https://github.com/rubygems/rubygems/commit/06ad654120 Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28Merge RubyGems/Bundler masterHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/fe96fb6e2ac5a8b6df5e852470d11fa854301eca Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-27Rust YJITAlan Wu
In December 2021, we opened an [issue] to solicit feedback regarding the porting of the YJIT codebase from C99 to Rust. There were some reservations, but this project was given the go ahead by Ruby core developers and Matz. Since then, we have successfully completed the port of YJIT to Rust. The new Rust version of YJIT has reached parity with the C version, in that it passes all the CRuby tests, is able to run all of the YJIT benchmarks, and performs similarly to the C version (because it works the same way and largely generates the same machine code). We've even incorporated some design improvements, such as a more fine-grained constant invalidation mechanism which we expect will make a big difference in Ruby on Rails applications. Because we want to be careful, YJIT is guarded behind a configure option: ```shell ./configure --enable-yjit # Build YJIT in release mode ./configure --enable-yjit=dev # Build YJIT in dev/debug mode ``` By default, YJIT does not get compiled and cargo/rustc is not required. If YJIT is built in dev mode, then `cargo` is used to fetch development dependencies, but when building in release, `cargo` is not required, only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer. The YJIT command-line options remain mostly unchanged, and more details about the build process are documented in `doc/yjit/yjit.md`. The CI tests have been updated and do not take any more resources than before. The development history of the Rust port is available at the following commit for interested parties: https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be Our hope is that Rust YJIT will be compiled and included as a part of system packages and compiled binaries of the Ruby 3.2 release. We do not anticipate any major problems as Rust is well supported on every platform which YJIT supports, but to make sure that this process works smoothly, we would like to reach out to those who take care of building systems packages before the 3.2 release is shipped and resolve any issues that may come up. [issue]: https://bugs.ruby-lang.org/issues/18481 Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com> Co-authored-by: Kevin Newton <kddnewton@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/5826
2022-04-22Avoid defining the same test class in multiple filesJeremy Evans
Should fix issues with parallel testing sometimes not running all tests. This should be viewed skipping whitespace changes. Fixes [Bug #18731] Notes: Merged: https://github.com/ruby/ruby/pull/5839
2022-04-21Uncomment code to raise LocalJumpError for yield across thread through enumJeremy Evans
Not sure if this is the correct fix. It does raise LocalJumpError in the yielding thread as you would expect, but the value yielded to the calling thread is still yielded without an exception. Fixes [Bug #18649] Notes: Merged: https://github.com/ruby/ruby/pull/5692
2022-04-22Use https for wss testHiroshi SHIBATA
2022-04-22[ruby/uri] Feat: Support WSSOKURA Masafumi
There was a file for WSS so I added one line of `require_relative` to make it work. Now `URI.parse('wss://example.com')` returns `URI::WS`. https://github.com/ruby/uri/commit/ff8a103564
2022-04-21[ruby/pathname] Implement Pathname#lutimeAkinori MUSHA
https://github.com/ruby/pathname/commit/268cb5acff
2022-04-21Private local variables should shadow outer variables [Bug #18629]Nobuyoshi Nakada
2022-04-20[ruby/net-http] Feature detect to make net/http usable with JRubyKarol Bucek
Handle missing session_new_cb= and do not call session_cache_mode=, as JRuby SSL does not support these methods. https://github.com/ruby/net-http/commit/3237ef4d8c
2022-04-20[ruby/net-http] Add ignore_eof access to HTTP and HTTPResponseJeremy Evans
The ignore_eof setting on HTTPResponse makes it so an EOFError is raised when reading bodies with a defined Content-Length, if the body read was truncated due to the socket be closed. The ignore_eof setting on HTTP sets the values used in responses that are created by the object. For backwards compatibility, the default is for both settings is true. However, unless you are specifically tested for and handling truncated responses, it's a good idea to set ignore_eof to false so that errors are raised for truncated responses, instead of those errors silently being ignored. Fixes [Bug #14972] https://github.com/ruby/net-http/commit/4d47e34995
2022-04-19Github -> GitHubTim Smith
Fix the case of GitHub in various places Signed-off-by: Tim Smith <tsmith@mondoo.com> Notes: Merged: https://github.com/ruby/ruby/pull/5817
2022-04-16Fix class ancestry checks for duped classesJohn Hawthorn
Previously in some when classes were duped (specifically those with a prepended module), they would not correctly have their "superclasses" array or depth filled in. This could cause ancestry checks (like is_a? and Module comparisons) to return incorrect results. This happened because rb_mod_init_copy builds origin classes in an order that doesn't have the super linked list fully connected until it's finished. This commit fixes the previous issue by calling rb_class_update_superclasses before returning the cloned class. This is similar to what's already done in make_metaclass. Notes: Merged: https://github.com/ruby/ruby/pull/5808
2022-04-16[rubygems/rubygems] Fix test issues surfaced using a stricter behavior of ↵David Rodríguez
`FileUtils` We were trying to remove directories using `FileUtils.rm_f` which is unexpected and does not remove anything. Changing to `FileUtils.rm_rf` actually removes the directories properly. That itself showed other issues: * One test was actually removing the gem package it was about to install, since it was living in the cache folder. To fix that, avoid removing the cache folder, and only make sure the other directories are created automatically, which seems enough. * Another test was actually removing an incorrect directory. Change it to remove the right one (the one that's asserted later to have been created). https://github.com/rubygems/rubygems/commit/5538e7ff20
2022-04-15Compare predicate methods as a boolean valueNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5803
2022-04-15[Win32] Fix mode of character/pipe device stat [Bug #18732]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5803
2022-04-14[ruby/rdoc] Apply matching word pairs to underscore-methodsNobuyoshi Nakada
Protected characters with `PROTECT_ATTR` should not have special roles. https://github.com/ruby/rdoc/commit/c318af0ea2