summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-09-09Add keys to GC.stat and fix testsPeter Zhu
This adds keys heap_empty_pages and heap_allocatable_slots to GC.stat.
2024-09-09Switch sorted list of pages in the GC to a darrayPeter Zhu
2024-09-09Implement String#append_as_bytes(String | Integer, ...)Jean Boussier
[Feature #20594] A handy method to construct a string out of multiple chunks. Contrary to `String#concat`, it doesn't do any encoding negociation, and simply append the content as bytes regardless of whether this result in a broken string or not. It's the caller responsibility to check for `String#valid_encoding?` in cases where it's needed. When passed integers, only the lower byte is considered, like in `String#setbyte`. Notes: Merged: https://github.com/ruby/ruby/pull/11552
2024-09-09Return back legacy Range#step behavior for symbol rangeszverok
Notes: Merged: https://github.com/ruby/ruby/pull/11573
2024-09-09[rubygems/rubygems] Make `gem exec` use the standard GEM_HOMEDavid Rodríguez
https://github.com/rubygems/rubygems/commit/032b3c518a
2024-09-09[rubygems/rubygems] Fix `gem fetch` always exiting with zero status codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5887e6dfa1
2024-09-09Implement WHEN NODE locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11553
2024-09-08[ruby/open-uri] Update error message for `request_specific_fields` option ↵otegami
validation Added `inspect` to the `request_specific_fields` value to provide better visibility for users in the exception message. https://github.com/ruby/open-uri/commit/f89ce5112d
2024-09-08[ruby/open-uri] Add test about `request_specific_fields` optionotegami
https://github.com/ruby/open-uri/commit/060886f312
2024-09-07[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`Koichi ITO
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for left parenthesis. ## Parser gem (Expected) Returns `tLPAREN2` token: ```console $ bundle exec ruby -Ilib -rparser/ruby33 \ -ve 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Parser::Ruby33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` ## `Prism::Translation::Parser` (Actual) Previously, the parser returned `tLPAREN` token when parsing the following: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` After the update, the parser now returns `tLPAREN2` token for the same input: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` The `PARENTHESIS_LEFT` token in Prism is classified as either `tLPAREN` or `tLPAREN2` in the Parser gem. The tokens that were previously all classified as `tLPAREN` are now also classified to `tLPAREN2`. With this change, the following code could be removed from `test/prism/ruby/parser_test.rb`: ```diff - when :tLPAREN - actual_token[0] = expected_token[0] if expected_token[0] == :tLPAREN2 ``` https://github.com/ruby/prism/commit/04d6f3478d
2024-09-07Preserve encoding in exception message of `Float`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11564
2024-09-07[Bug #20719] `Float` argument must be ASCII compatibleNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11564
2024-09-06[rubygems/rubygems] Fix `gem install does-not-exist` being super slowDavid Rodríguez
Every time a gem is not found in the Compact Index API, RubyGems will fallback to the full index, which is very slow. This is unnecessary because both indexes should be providing the same gems, so if a gem can't be found in the Compact Index API, it won't be found in the full index. We _do_ want a fallback to the full index, whenever the Compact Index API is not implemented. To detect that, we check that the API responds to the "/versions" endpoint, just like Bundler does. Before: ``` $ time gem install fooasdsfafs ERROR: Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository gem 20,77s user 0,59s system 96% cpu 22,017 total ``` After: ``` $ time gem install fooasdsfafs ERROR: Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository gem 5,02s user 0,09s system 91% cpu 5,568 total ``` https://github.com/rubygems/rubygems/commit/c0d6b9eea7
2024-09-06[ruby/openssl] Fix test_provider.rb in FIPS.Jun Aruga
https://github.com/ruby/openssl/commit/7bdbc52100
2024-09-06[rubygems/rubygems] Ensure that the lock file will be removedNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/2706acb271
2024-09-06[rubygems/rubygems] Remove the lock file for binstubsNobuyoshi Nakada
https://github.com/rubygems/rubygems/pull/7806#issuecomment-2241662488 https://github.com/rubygems/rubygems/commit/4f06ee234a
2024-09-06[Feature #20707] Fix negative UTC offset conversionNobuyoshi Nakada
In short, get rid of division and modulo of negative integers. Notes: Merged: https://github.com/ruby/ruby/pull/11561
2024-09-05Move Time#xmlschema in core and optimize itJean Boussier
[Feature #20707] Converting Time into RFC3339 / ISO8601 representation is an significant hotspot for applications that serialize data in JSON, XML or other formats. By moving it into core we can optimize it much further than what `strftime` will allow. ``` compare-ruby: ruby 3.4.0dev (2024-08-29T13:11:40Z master 6b08a50a62) +YJIT [arm64-darwin23] built-ruby: ruby 3.4.0dev (2024-08-30T13:17:32Z native-xmlschema 34041ff71f) +YJIT [arm64-darwin23] warming up...... | |compare-ruby|built-ruby| |:-----------------------|-----------:|---------:| |time.xmlschema | 1.087M| 5.190M| | | -| 4.78x| |utc_time.xmlschema | 1.464M| 6.848M| | | -| 4.68x| |time.xmlschema(6) | 859.960k| 4.646M| | | -| 5.40x| |utc_time.xmlschema(6) | 1.080M| 5.917M| | | -| 5.48x| |time.xmlschema(9) | 893.909k| 4.668M| | | -| 5.22x| |utc_time.xmlschema(9) | 1.056M| 5.707M| | | -| 5.40x| ``` Notes: Merged: https://github.com/ruby/ruby/pull/11510
2024-09-05[ruby/reline] Prevent a warning for `warning: literal string will beMari Imaizumi
frozen in the future` (https://github.com/ruby/reline/pull/744) https://github.com/ruby/reline/commit/69c95c8b6a
2024-09-05Optimized instruction for Hash#freezeÉtienne Barrié
If a Hash which is empty or only using literals is frozen, we detect this as a peephole optimization and change the instructions to be `opt_hash_freeze`. [Feature #20684] Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/11406
2024-09-05Optimized instruction for Array#freezeÉtienne Barrié
If an Array which is empty or only using literals is frozen, we detect this as a peephole optimization and change the instructions to be `opt_ary_freeze`. [Feature #20684] Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/11406
2024-09-05[ruby/openssl] Fix test_pkey_rsa.rb in FIPS.Jun Aruga
* test_sign_verify I created the signature text (`signature_encoded.txt`), that is used as a text to create the `signature0` in the `test_sign_verify` by the following steps with the `openssl` CLI on FIPS module. ``` $ OPENSSL_DIR="${HOME}/.local/openssl-3.4.0-dev-fips-debug-3c6e114959" $ export OPENSSL_CONF="${OPENSSL_DIR}/ssl/openssl_fips.cnf" $ echo -n "Sign me!" > data.txt $ "${OPENSSL_DIR}/bin/openssl" dgst -sha256 -sign test/openssl/fixtures/pkey/rsa2048.pem data.txt > signature.txt $ cat signature.txt | base64 > signature_encoded.txt ``` https://github.com/ruby/openssl/commit/091f3eb421
2024-09-05Implement AND/OR NODE operator locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11543
2024-09-04Implement VALIAS NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11531
2024-09-04[Bug #20708] Retry `open` on EINTRNobuyoshi Nakada
Co-Authored-By: Martin Dorey <martin.dorey@hds.com> Notes: Merged: https://github.com/ruby/ruby/pull/11537
2024-09-03Allow Errno::EACCES when testing connection timeoutJeremy Evans
Some packaging systems that include support for running tests, such as OpenBSD's, do not allow outbound network connections during testing for security reasons. EACCES is the error raised by OpenBSD in this case. Notes: Merged: https://github.com/ruby/ruby/pull/11535 Merged-By: jeremyevans <code@jeremyevans.net>
2024-09-03[rubygems/rubygems] standardize pretty-print output for Gem::Source and ↵Durable Programming Team
subclasses https://github.com/rubygems/rubygems/commit/6d5fbf82f1
2024-09-03[ruby/irb] Fix easter_egg run without RDoc, fix input-method testtomoya ishida
run without RDoc (https://github.com/ruby/irb/pull/998) * EasterEgg no longer depend on RDoc * Run most of the input-method tests even if RDoc is not avialable https://github.com/ruby/irb/commit/30fa1595d9
2024-09-03[ruby/reline] Add test for reset_variables in Reline::ConfigMari Imaizumi
(https://github.com/ruby/reline/pull/741) * Fix reset variables * Add assertion for reload * Add helper method to get instance variable value of Reline::Config https://github.com/ruby/reline/commit/386f619ff5
2024-09-03[ruby/reline] Fix redisplay/insert_text called from pre_input_hooktomoya ishida
(https://github.com/ruby/reline/pull/742) * Fix redisplay/insert_text called from pre_input_hook * Rename insert_pasted_text to insert_multiline_text It is now used from Reline.insert_text which is not inserting pasted text https://github.com/ruby/reline/commit/694a540939
2024-09-03Implement ALIAS NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11530
2024-09-03Implement UNDEF NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11523
2024-09-03Range#step: restore legacy behavior for String rangeszverok
Notes: Merged: https://github.com/ruby/ruby/pull/11454
2024-09-03[flori/json] Use the compiled extension in testÉtienne Barrié
https://github.com/flori/json/commit/148afef84c
2024-09-02Fix flaky test_latest_gc_info_need_major_byPeter Zhu
It's possible for a GC to run between the calls of GC.latest_gc_info, which would cause the test to fail. We can disable GC so that GC only triggers manually.
2024-09-02[rubygems/rubygems] Simplify `Gem.read_binary` and `Gem.write_binary`Nobuyoshi Nakada
Since `Gem.open_file` no longer locks the target file and is same as `File.open` now, simply `Gem.read_binary` should read in binary mode. Also the body of `Gem.write_binary` is same as `File.binwrite`. https://github.com/rubygems/rubygems/commit/44df9045df
2024-09-01Skip show_doc tests if RDoc is not availableHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11491
2024-09-01Skip RDoc related feature if Gem::RDoc is not availableHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11491
2024-08-31[rubygems/rubygems] fix `@license` typo preventing licenses from being ↵Durable Programming Team
correctly unmarshalled https://github.com/rubygems/rubygems/commit/d6ba7ef79f
2024-08-31[ruby/io-console] Store console IO in Ractor-local storageNobuyoshi Nakada
Ractor requires a shareable class has shareable constants only, but IO is not shareable unless frozen. https://github.com/ruby/io-console/commit/65e0ff895c
2024-08-31[ruby/io-console] io-console is considered Ractor-safeNobuyoshi Nakada
https://github.com/ruby/io-console/commit/b1adc15af7
2024-08-31[ruby/reline] Implement re-read-init-fileMari Imaizumi
(https://github.com/ruby/reline/pull/740) https://github.com/ruby/reline/commit/59e4ade807
2024-08-29Stop using the "undef" keyword to remove a constantAlan Wu
The keyword tries to remove a method of the same name which is unlikely to be the intention of this test: $ ruby -e 'undef Object' -e:1:in '<main>': undefined method 'Object' for class 'Object' (NameError) Found looking at GH-11497. The NameError triggers error_highlight, which loads a bunch of file under GC.stress set by this test when using Prism. That takes a long time, causing a timeout.
2024-08-29[Bug #20704] Win32: Fix chdir to non-ASCII pathNobuyoshi Nakada
On Windows, `chdir` in compilers' runtime libraries uses the active code page, but command line arguments in ruby are always UTF-8, since commit:33ea2646b98adb49ae2e1781753bf22d33729ac0. Notes: Merged: https://github.com/ruby/ruby/pull/11493
2024-08-29Make optional benchmark test in OpenSSL::OSSL#test_memcmp_timingHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11490
2024-08-29Make optional benchmark test in ↵Hiroshi SHIBATA
test_find_in_unresolved_tree_is_not_exponentiental Notes: Merged: https://github.com/ruby/ruby/pull/11490
2024-08-29Don't use benchmark for test_activate_via_require_respects_loaded_filesHiroshi SHIBATA
benchmark.rb may extract as bundled gems in the future release Notes: Merged: https://github.com/ruby/ruby/pull/11490
2024-08-29Removed redundant require for TestGemRequireHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11490
2024-08-29Surpressing 'unknown command: “Switch to inspect mode.”' messageHiroshi SHIBATA
2024-08-28[ruby/prism] Multi-splat flag for argumentsKevin Newton
https://github.com/ruby/prism/commit/21cb9b78ae