summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-04-18Add a skipped test case for opt_mult overflowTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Implement all basic Fixnum instructions ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/50) * Implement all basic Fixnum instructions * Use opnd! macro for other instructions as well Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Compile FixnumLt (https://github.com/Shopify/zjit/pull/48)Max Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add comments to testsMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add commented out if-else test to test_zjit.rbMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add while loop test to test_zjit.rbMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add small test for setlocalMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Set a return value before popping registers ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/41) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Implement Insn::FixnumSub (https://github.com/Shopify/zjit/pull/42)Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Pass test results using #inspectTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Assert everything is compiled in test_zjit ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/40) * Assert everything is compiled in test_zjit * Update a comment on rb_zjit_assert_compiles Co-authored-by: Maxime Chevalier-Boisvert <[email protected]> * Add a comment about assert_compiles * Actually use pipe_fd --------- Co-authored-by: Maxime Chevalier-Boisvert <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18[Feature #20724] Bump Unicode version to 16.0.0Mari Imaizumi
Notes: Merged: https://github.com/ruby/ruby/pull/13117
2025-04-17Only test on known good platforms. (#13123)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2025-04-17Prefer `th->ec` for stack base/size. (#13101)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2025-04-16[ruby/openssl] ssl: fix SSLSocket#syswrite with String-convertible objectsKazuki Yamaguchi
Correctly pass the new object assigned by StringValue() to ossl_ssl_write_internal_safe(). This is a follow-up to commit https://github.com/ruby/openssl/commit/0d8c17aa855d (Reduce OpenSSL::Buffering#do_write overhead, 2024-12-21). https://github.com/ruby/openssl/commit/3ff096196a
2025-04-16[rubygems/rubygems] Fixed rubocop issue: Layout/SpaceInsideBlockBracesHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/77a52b011a
2025-04-16Run the proper version of `rake`Nobuyoshi Nakada
2025-04-15`IO.select` accepts +Float::INFINITY+ as a timeout argument.Tanaka Akira
matz accepted at the developper meeting 2024-07-11.
2025-04-15Lazily create `objspace->id_to_obj_tbl`Jean Boussier
This inverse table is only useful if `ObjectSpace._id2ref` is used, which is extremely rare. The only notable exception is the `drb` gem and even then it has an option not to rely on `_id2ref`. So if we assume this table will never be looked up, we can just not maintain it, and if it turns out `_id2ref` is called, we can lock the VM and re-build it. ``` compare-ruby: ruby 3.5.0dev (2025-04-10T09:44:40Z master 684cfa42d7) +YJIT +PRISM [arm64-darwin24] built-ruby: ruby 3.5.0dev (2025-04-10T10:13:43Z lazy-id-to-obj d3aa9626cc) +YJIT +PRISM [arm64-darwin24] warming up.. | |compare-ruby|built-ruby| |:----------|-----------:|---------:| |baseline | 26.364M| 25.974M| | | 1.01x| -| |object_id | 10.293M| 14.202M| | | -| 1.38x| ``` Notes: Merged: https://github.com/ruby/ruby/pull/13115
2025-04-12[ruby/prism] Fix parsing rescued exception via indexed assignmentviralpraxis
Given this code ```ruby begin raise '42' rescue => A[] end ``` Prism fails with this backtrace ``` Error: test_unparser/corpus/literal/rescue.txt(Prism::ParserTest): NoMethodError: undefined method `arguments' for nil prism/lib/prism/translation/parser/compiler.rb:1055:in `visit_index_target_node' prism/lib/prism/node.rb:9636:in `accept' prism/lib/prism/compiler.rb:30:in `visit' prism/lib/prism/translation/parser/compiler.rb:218:in `visit_begin_node' ``` Seems like ```diff - visit_all(node.arguments.arguments), + visit_all(node.arguments&.arguments || []), ``` fixes the problem. https://github.com/ruby/prism/commit/76d01aeb6c
2025-04-10Restore the original order of const_added and inherited callbacksXavier Noria
Originally, if a class was defined with the class keyword, the cref had a const_added callback, and the superclass an inherited callback, const_added was called first, and inherited second. This was discussed in https://bugs.ruby-lang.org/issues/21143 and an attempt at changing this order was made. While both constant assignment and inheritance have happened before these callbacks are invoked, it was deemed nice to have the same order as in C = Class.new This was mostly for alignment: In that last use case things happen at different times and therefore the order of execution is kind of obvious, whereas when the class keyword is involved, the order is opaque to the user and it is up to the interpreter. However, soon in https://bugs.ruby-lang.org/issues/21193 Matz decided to play safe and keep the existing order. This reverts commits: de097fbe5f3df105bd2a26e72db06b0f5139bc1a de48e47ddf78aba02fd9623bc7ce685540a10743 Notes: Merged: https://github.com/ruby/ruby/pull/13085
2025-04-09Fix coverage measurement for negative line numbersYusuke Endoh
Fixes [Bug #21220] Co-Authored-By: Mike Bourgeous <[email protected]> Co-Authored-By: Jean Boussier <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/13089
2025-04-09Refine dirname test on WindowsNobuyoshi Nakada
- Compare with the root of the target file - Fix root path of UNC path Notes: Merged: https://github.com/ruby/ruby/pull/13090
2025-04-09Restore assertion that is not related mswin platformHiroshi SHIBATA
2025-04-08[ruby/openssl] Fix the tests using SHA-1 Probabilistic Signature Scheme ↵Jun Aruga
(PSS) parameters. Fedora OpenSSL 3.5 on rawhide stopped accepting SHA-1 PSS[1] parameters. This is different from the SHA-1 signatures which Fedora OpenSSL stopped accepting since Fedora 41.[2] This commit fixes the following test failures related to the SHA-1 PSS parameters with Fedora OpenSSL 3.5. Note these failures are the downstream Fedora OpenSSL RPM specific. The tests pass without this commit with the upstream OpenSSL 3.5. ``` $ rpm -q openssl-libs openssl-devel openssl-libs-3.5.0-2.fc43.x86_64 openssl-devel-3.5.0-2.fc43.x86_64 $ bundle exec rake test ... E =============================================================================================== Error: test_sign_verify_options(OpenSSL::TestPKeyRSA): OpenSSL::PKey::PKeyError: EVP_PKEY_CTX_ctrl_str(ctx, "rsa_mgf1_md", "SHA1"): digest not allowed (digest=SHA1) /mnt/git/ruby/openssl/test/openssl/test_pkey_rsa.rb:113:in 'Hash#each' /mnt/git/ruby/openssl/test/openssl/test_pkey_rsa.rb:113:in 'OpenSSL::PKey::PKey#sign' /mnt/git/ruby/openssl/test/openssl/test_pkey_rsa.rb:113:in 'OpenSSL::TestPKeyRSA#test_sign_verify_options' 110: "rsa_pss_saltlen" => 20, 111: "rsa_mgf1_md" => "SHA1" 112: } => 113: sig_pss = key.sign("SHA256", data, pssopts) 114: assert_equal 256, sig_pss.bytesize 115: assert_equal true, key.verify("SHA256", sig_pss, data, pssopts) 116: assert_equal true, key.verify_pss("SHA256", sig_pss, data, =============================================================================================== E =============================================================================================== Error: test_sign_verify_pss(OpenSSL::TestPKeyRSA): OpenSSL::PKey::RSAError: digest not allowed (digest=SHA1) /mnt/git/ruby/openssl/test/openssl/test_pkey_rsa.rb:191:in 'OpenSSL::PKey::RSA#sign_pss' /mnt/git/ruby/openssl/test/openssl/test_pkey_rsa.rb:191:in 'OpenSSL::TestPKeyRSA#test_sign_verify_pss' 188: data = "Sign me!" 189: invalid_data = "Sign me?" 190: => 191: signature = key.sign_pss("SHA256", data, salt_length: 20, mgf1_hash: "SHA1") 192: assert_equal 256, signature.bytesize 193: assert_equal true, 194: key.verify_pss("SHA256", signature, data, salt_length: 20, mgf1_hash: "SHA1") =============================================================================================== ... 577 tests, 4186 assertions, 0 failures, 2 errors, 0 pendings, 3 omissions, 0 notifications ``` [1] https://en.wikipedia.org/wiki/Probabilistic_signature_scheme [2] https://fedoraproject.org/wiki/Changes/OpenSSLDistrustSHA1SigVer https://github.com/ruby/openssl/commit/e0e771b76f
2025-04-08Windows 11 24H2 with VS 2019 16.11.45 couldn't handle long name testHiroshi SHIBATA
``` 2) Error: TestDir#test_children_long_name: Test::Unit::ProxyError: No such file or directory @ apply2files - C:/Users/hsbt/AppData/Local/Temp/rubytest.zxydnz/d20250408-35424-2b0o6e/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/c V:/github.com/ruby/ruby/test/ruby/test_dir.rb:653:in 'File.unlink' V:/github.com/ruby/ruby/test/ruby/test_dir.rb:653:in 'block in TestDir#test_children_long_name' V:/github.com/ruby/ruby/lib/tmpdir.rb:105:in 'Dir.mktmpdir' V:/github.com/ruby/ruby/test/ruby/test_dir.rb:646:in 'TestDir#test_children_long_name' ```
2025-04-08Skip some assertions of TestFileExhaustive#test_dirname with Windows platform.Hiroshi SHIBATA
These assertions didn't handle drive letter of Windows ``` 1) Failure: TestFileExhaustive#test_dirname [V:/github.com/ruby/ruby/test/ruby/test_file_exhaustive.rb:1282]: <"V:/"> expected but was <"C:/">. ```
2025-04-07Skip test_heaps_grow_independently for MMTkPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/13061
2025-04-07Grow GC heaps independentlyPeter Zhu
[Bug #21214] If we allocate objects where one heap holds transient objects and another holds long lived objects, then the heap with transient objects will grow along the heap with long lived objects, causing higher memory usage. For example, we can see this issue in this script: def allocate_small_object = [] def allocate_large_object = Array.new(10) arys = Array.new(1_000_000) do # Allocate 10 small transient objects 10.times { allocate_small_object } # Allocate 1 large object that is persistent allocate_large_object end pp GC.stat pp GC.stat_heap Before this change: heap_live_slots: 2837243 {0 => {slot_size: 40, heap_eden_pages: 1123, heap_eden_slots: 1838807}, 2 => {slot_size: 160, heap_eden_pages: 2449, heap_eden_slots: 1001149}, } After this change: heap_live_slots: 1094474 {0 => {slot_size: 40, heap_eden_pages: 58, heap_eden_slots: 94973}, 2 => {slot_size: 160, heap_eden_pages: 2449, heap_eden_slots: 1001149}, } Notes: Merged: https://github.com/ruby/ruby/pull/13061
2025-04-07Fix `Integer.sqrt` to never exceed actual valueYusuke Endoh
`Integer.sqrt` uses `sqrt(3)` from libm for small values. This method must return a value less than or equal to the actual integer square root, but libm's sqrt does not always guarantee that. This change corrects that by decrementing the result if necessary. Fixes [Bug #21217] Notes: Merged: https://github.com/ruby/ruby/pull/13076
2025-04-04Fixed mismatched indentationHiroshi SHIBATA
2025-04-04Removed unused variableHiroshi SHIBATA
2025-04-03[ruby/openssl] pkcs7: fix test failure on RHEL 9Kazuki Yamaguchi
The test case test_split_content fails on RHEL 9 and Fedora 41 because their OpenSSL packages do not accept SHA-1 signatures. This was only caught after commit https://github.com/ruby/openssl/commit/69fd7f886313 added the missing assertion. While the example PKCS#7 structures could be simply regenerated with SHA-256, this test case could be simplified because it is checking two different things. Replace test_split_content with separate test cases: one verifying signed-data authenticatedAttributes and another for decoding BER input. Fixes https://github.com/ruby/openssl/issues/875 https://github.com/ruby/openssl/commit/b32406b0c1
2025-04-03[ruby/openssl] pkcs7: update test case test_graceful_parsing_failureKazuki Yamaguchi
Using test_pkcs7.rb as an example invalid input is not reliable because we may happen to include a valid PKCS#7 PEM block in a heredoc. https://github.com/ruby/openssl/commit/76fead26d2
2025-04-03Use EnvUtil.apply_timeout_scaleHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13058
2025-04-03Extend open_timeout for test failure on s390xHiroshi SHIBATA
https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20250403T060004Z.fail.html.gz Notes: Merged: https://github.com/ruby/ruby/pull/13058
2025-04-02Fix assertion failure with anonymous splatsJeremy Evans
When calling a method that accepts an anonymous splat and literal keywords without any arguments, an assertion failure was previously raised. Set rest_index to 0 when setting rest to the frozen hash, so the args_argc calculation is accurate. While here, add more tests for methods with anonymous splats with and without keywords and keyword splats to confirm behavior is correct. Also add a basic bootstrap test that would hit the previous assertion failure. Co-authored-by: Jean Boussier <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/13046
2025-04-02[ruby/prism] Be explicit in tests which files `parser` can't parseEarlopain
It also updates to latest `parser`, which allows numbered parameters in pattern matching pin, passing `patterns.txt` and `case.txt` https://github.com/ruby/prism/commit/bdcc8b3dc5
2025-04-02[ruby/prism] Fix parser translator when splatting in pattern matching pinEarlopain
Because it ends up treating it as a local variable, and `a.x` is not a valid local variable name. I'm not big on pattern matching, but conceptually it makes sense to me to treat anything inside ^() to not be pattern matching syntax? https://github.com/ruby/prism/commit/80dbd85c45
2025-04-02Fixup comment for Windows platform, not SolarisHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13037
2025-04-02Removed Solaris conditions from test filesHiroshi SHIBATA
We no longer execute those files with Solaris platforms. Notes: Merged: https://github.com/ruby/ruby/pull/13037
2025-04-01[Bug #21203] Skip TestGc#test_gc_parameter_init_slots since it is flaky (#13025)Naoto Ono
https://bugs.ruby-lang.org/issues/21203 TestGc#test_gc_parameter_init_slots is a flaky test that fails intermittently. Until the issue with flakiness is resolved, I will skip it. Notes: Merged-By: ono-max <[email protected]>
2025-04-01[rubygems/rubygems] Bump up minimum required version for cmake 4Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3e77caeddf
2025-03-31ractor: don't inherit the default thread groupJean Boussier
[Bug #17506] `Thread.current.group` isn't shareable so it shouldn't be inherited by the main thread of a new Ractor. This cause an extra allocation when spawning a ractor, which could be elided with a bit of extra work, but not sure if it's worth the effort. Notes: Merged: https://github.com/ruby/ruby/pull/13013
2025-03-31[ruby/json] Remove caller location assertionsJean Boussier
Fix: https://github.com/ruby/json/pull/781 Tests are ran a bit differently in ruby/ruby and this assertion breaks. https://github.com/ruby/json/commit/0d4fc669ed
2025-03-31Revert "Relax assertion pattern for ruby repo"Hiroshi SHIBATA
This reverts commit 09b94688731a73a4ee63969a22ba7d537223e02a.
2025-03-30[ruby/prism] Fix parser translator when pinning hash with string keysEarlopain
`StringNode` and `SymbolNode` don't have the same shape (`content` vs `value`) and that wasn't handled. I believe the logic for the common case can be reused. I simply left the special handling for implicit nodes in pattern matching and fall through otherwise. NOTE: patterns.txt is not actually tested at the moment, because it contains syntax that `parser` mistakenly rejects. But I checked manually that this doesn't introduce other failures. https://github.com/whitequark/parser/pull/1060 https://github.com/ruby/prism/commit/55adfaa895
2025-03-30[ruby/prism] Accept a newline after the defined? keywordKevin Newton
[Bug #21197] https://github.com/ruby/prism/commit/22be955ce9 Notes: Merged: https://github.com/ruby/ruby/pull/12999
2025-03-30[ruby/openssl] Skip PKCS7 with indefinite length test in AWS-LCSamuel Chiang
AWS-LC had been decoding the indefinite BER to an unusable output. We should skip the test until indefinite BER decoding in AWS-LC is properly fixed. Changes: 1. AWS-LC will be looking to fix the parsing for indefinite BER constructed strings in AWS-LC soon, so I've marked the test as `pend` for now and removed the AWS-LC specific logic at the end. 2. I've added an assertion to verify that `OpenSSL::PKCS7.verify` behaves correctly before doing content comparisons. I noticed this was failing initially in AWS-LC, but that will be fixed soon as well. This shouldn't effect OpenSSL/LibreSSL builds and should improve the test. https://github.com/ruby/openssl/commit/69fd7f8863
2025-03-29[Bug #21202] Fix wrong token concat while tokenizing nested unterminated ↵tomoya ishida
heredoc (#13000) Notes: Merged-By: tompng <[email protected]>