summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-08-17[rubygems/rubygems] Raise Gem::Package::FormatError on EOF, indicating ↵Martin Emde
corrupt gem Gem::Package::TarReader::Entry now raises EOFError or returns nil appropriately based on Ruby core IO.read and IO.readpartial behavior. Zlib will respond accordingly by raising Zlib::GzipFile::Error on EOF. When verifying a gem or extracting contents, raise FormatError similar to other cases of corrupt gems. Addresses a bug where Gem::Package would attempt to call size on nil instead of raising a more descriptive and useful error, leading users to assume the problem is internal to rubygems. Remove unused error class TarReader::UnexpectedEOF that was never raised since the NoMethodError on nil would happen first. Use EOFError instead. https://github.com/rubygems/rubygems/commit/dc6129644b
2023-08-17Move total_freed_objects to size poolPeter Zhu
This commit moves the `total_freed_objects` statistic to the size pool which allows for `total_freed_objects` key in `GC.stat_heap`. Notes: Merged: https://github.com/ruby/ruby/pull/8231
2023-08-17Move total_allocated_objects to size poolPeter Zhu
This commit moves the `total_allocated_objects` statistic to the size pool which allows for `total_allocated_objects` key in `GC.stat_heap`. Notes: Merged: https://github.com/ruby/ruby/pull/8231
2023-08-17Resync YARP to https://github.com/ruby/yarp/commit/11ad3fb590Takashi Kokubun
2023-08-17Resync YARPTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/8234
2023-08-17YJIT: implement side chain fallback for setlocal to avoid exiting (#8227)Maxime Chevalier-Boisvert
* YJIT: implement side chain fallback for setlocal to avoid exiting * Update yjit/src/codegen.rs Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-08-16Move the PC regardless of the leaf flag (#8232)Takashi Kokubun
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-08-17[ruby/yarp] Fix errors on locals test caused by LANG=CKevin Newton
https://github.com/ruby/yarp/commit/8fae286bc9
2023-08-16[ruby/yarp] Omit locals test if running on a 32 bit machineJemma Issroff
https://github.com/ruby/yarp/commit/809d046f36 Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16Resync YARPTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Add test for empty heredocKevin Newton
https://github.com/ruby/yarp/commit/e49b63a79e Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Fixes so `bundle exec rake` can run on JRuby and TruffleRubyBenoit Daloze
https://github.com/ruby/yarp/commit/e6cea4fa08 Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Test all methods of the YARP Ruby APIBenoit Daloze
https://github.com/ruby/yarp/commit/a723f40baf Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] add a diagnostic for *rest in order after optional stateHParker
https://github.com/ruby/yarp/commit/908244ba12 Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] More flip flop flagsKevin Newton
Whenever you see a `not` or a `!`, the receiver of that method should potentially be marked as a flip-flop. https://github.com/ruby/yarp/commit/ba5977a40a Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Support the flipflop flagKevin Newton
https://github.com/ruby/yarp/commit/6315890390 Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Fix string concat parsingKevin Newton
https://github.com/ruby/yarp/commit/58f839a3eb Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Parse individual snippets of test/fixtures/*.txtBenoit Daloze
* To ensure the parser does not try to read bytes further than the end of each snippet. https://github.com/ruby/yarp/commit/1c4438bdde Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Fix test to use the new location of yarp.soBenoit Daloze
https://github.com/ruby/yarp/commit/a22b204a11 Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Automatically find the right line for yarp/serialize.rb newline testBenoit Daloze
https://github.com/ruby/yarp/commit/5908130541 Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Hide debug methodsKevin Newton
https://github.com/ruby/yarp/commit/aa0dc2f301 Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Add constant write nodeKevin Newton
https://github.com/ruby/yarp/commit/a62f2f0153 Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Simplify creation of numericsKevin Newton
https://github.com/ruby/yarp/commit/e5f6ffa23a Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Test YARP.parse_file by using it in testsBenoit Daloze
https://github.com/ruby/yarp/commit/c603bba89a Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/yarp] Split out newline testKevin Newton
https://github.com/ruby/yarp/commit/eeb4f6cb9d Notes: Merged: https://github.com/ruby/ruby/pull/8226
2023-08-16[ruby/openssl] test/openssl/test_pkey.rb: Fix pending tests in FIPS case.Jun Aruga
https://github.com/ruby/openssl/commit/f9980d88aa
2023-08-16[ruby/openssl] Use openssl? instead of OpenSSL::OPENSSL_VERSION_NUMBER.Jun Aruga
Update the `openssl?` method by adding status argument. Note the format is below. * OpenSSL 3: 0xMNN00PP0 (major minor 00 patch 0) * OpenSSL 1: 0xMNNFFPPS (major minor fix patch status) See <https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_VERSION_NUMBER.html> for details. https://github.com/ruby/openssl/commit/db8deaacd3
2023-08-16[ruby/openssl] Include "additional data" message in OpenSSL errorsKazuki Yamaguchi
Error entries in the OpenSSL error queue may contain additional contextual information associated with the error, which can be helpful when debugging. This "additional data" is currently only printed to stderr when OpenSSL.debug is enabled. Let's include this in the exception messages raised with ossl_raise(), too. $ ruby -Ilib -ropenssl -e'OpenSSL.debug=true; OpenSSL::SSL::SSLContext.new.ecdh_curves="P-256:not-a-curve"' -e:1: warning: error on stack: error:0A080106:SSL routines:gid_cb:passed invalid argument (group 'not-a-curve' cannot be set) -e:1:in `ecdh_curves=': passed invalid argument (group 'not-a-curve' cannot be set) (OpenSSL::SSL::SSLError) from -e:1:in `<main>' https://github.com/ruby/openssl/commit/1c5bbdd68e
2023-08-16[ruby/openssl] config: relax test assertions against error messagesKazuki Yamaguchi
Test that the error message contains the necessary text instead of the exact match. Exceptions raised by ossl_raise() may carry additional context information in the message. https://github.com/ruby/openssl/commit/fd6f76c0d3
2023-08-16[ruby/openssl] ssl: raise SSLError if loading ca_file or ca_path failsKazuki Yamaguchi
When compiled with OpenSSL <= 1.1.1, OpenSSL::SSL::SSLContext#setup does not raise an exception on an error return from SSL_CTX_load_verify_locations(), but instead only prints a verbose-mode warning. This is not helpful since it very likely indicates an actual error, such as the specified file not being readable. Also, OpenSSL's error queue is not correctly cleared: $ ruby -w -ropenssl -e'OpenSSL.debug=true; ctx=OpenSSL::SSL::SSLContext.new; ctx.ca_file="bad-path"; ctx.setup; pp OpenSSL.errors' -e:1: warning: can't set verify locations ["error:02001002:system library:fopen:No such file or directory", "error:2006D080:BIO routines:BIO_new_file:no such file", "error:0B084002:x509 certificate routines:X509_load_cert_crl_file: system lib"] The behavior is currently different when compiled with OpenSSL >= 3.0: SSLError is raised if SSL_CTX_load_verify_file() or SSL_CTX_load_verify_dir() fails. This inconsistency was unintentionally introduced by commit https://github.com/ruby/openssl/commit/5375a55ffc35 ("ssl: use SSL_CTX_load_verify_{file,dir}() if available", 2020-02-22). However, raising SSLError seems more appropriate in this situation. Let's adjust the OpenSSL <= 1.1.1 code so that it behaves the same way as the OpenSSL >= 3.0 code currently does. Fixes: https://github.com/ruby/openssl/issues/649 https://github.com/ruby/openssl/commit/7eb10f7b75
2023-08-16[ruby/openssl] Revert "Relax error message check for OpenSSL 3.1"Kazuki Yamaguchi
This reverts commit https://github.com/ruby/openssl/commit/fc4629d246f2. The test case "test_connect_certificate_verify_failed_exception_message" does want to check the reason behind a certificate verification failure to be included in the exception message. https://github.com/ruby/openssl/commit/c309745eb8
2023-08-15Add stat force_incremental_marking_finish_countPeter Zhu
This commit adds key force_incremental_marking_finish_count to GC.stat_heap. This statistic returns the number of times the size pool has forced incremental marking to finish due to running out of slots.
2023-08-15Add description to the empty test file [ci skip]Nobuyoshi Nakada
2023-08-15* append newline at EOF. [ci skip]git
2023-08-15An empty test file for satisfy chkbuild [ci skip]Nobuyoshi Nakada
2023-08-15Remove a misplaced and duplicate file [ci skip]Nobuyoshi Nakada
2023-08-13[ruby/irb] Support seamless integration with ruby/debugStan Lo
(https://github.com/ruby/irb/pull/575) * Support native integration with ruby/debug * Prevent using multi-irb and activating debugger at the same time Multi-irb makes a few assumptions: - IRB will manage all threads that host sub-irb sessions - All IRB sessions will be run on the threads created by IRB itself However, when using the debugger these assumptions are broken: - `debug` will freeze ALL threads when it suspends the session (e.g. when hitting a breakpoint, or performing step-debugging). - Since the irb-debug integration runs IRB as the debugger's interface, it will be run on the debugger's thread, which is not managed by IRB. So we should prevent the 2 features from being used at the same time. To do that, we check if the other feature is already activated when executing the commands that would activate the other feature. https://github.com/ruby/irb/commit/d8fb3246be
2023-08-13[ruby/irb] Move IO configuration to IRB::IrbStan Lo
(https://github.com/ruby/irb/pull/681) It shouldn't be `RubyLex`'s responsibility to handle IO. So this moves the configuration to `IRB::Irb`. https://github.com/ruby/irb/commit/daff750076
2023-08-13Move test files of ruby/set under `test/set`Nobuyoshi Nakada
Chkbuild fires accidentally on `test/fixtures` directory. Notes: Merged: https://github.com/ruby/ruby/pull/8214
2023-08-13Prefix `excludes` with a dot to prevent chkbuild from firing wronglyNobuyoshi Nakada
Chkbuild runs for each directories just under `test` directory when `test-all` failed. `test/excludes` itself should not be a target. Notes: Merged: https://github.com/ruby/ruby/pull/8214
2023-08-13Fix the precedence of `--backtrace-limit` optionNobuyoshi Nakada
In general, if the same option specifying a single value is given multiple times at the same level, the last one overrides the earlier ones, unless prohibited. Notes: Merged: https://github.com/ruby/ruby/pull/8212
2023-08-12[ruby/irb] Drop showing indent level number in DEFAULT prompt andtomoya ishida
INF_RUBY prompt (https://github.com/ruby/irb/pull/679) * Drop showing indent level number in DEFAULT prompt and INF_RUBY prompt * Update prompt part of test_rendering's expected result https://github.com/ruby/irb/commit/3847532e54
2023-08-11[ruby/irb] Remove needless removal of trailing whitespace intomoya ishida
check_code_state (https://github.com/ruby/irb/pull/678) https://github.com/ruby/irb/commit/4a6af7d1ed
2023-08-11[ruby/irb] Move assignment check to RubyLexStan Lo
(https://github.com/ruby/irb/pull/670) Since assignment check relies on tokenization with `Ripper`, it feels like the responsibility of `RubyLex`. `Irb#eval_input` should simply get the result when calling `each_top_level_statement` on `RubyLex`. https://github.com/ruby/irb/commit/89d1adb3fd
2023-08-11[ruby/irb] Skip integration tests in core CIStan Lo
(https://github.com/ruby/irb/pull/677) We already skipped history integration tests in core CI in #675 due to suspicion on nested IRB sessions don't work on certain operating systems. But after #669, the evaluation integration test also started to fail on some Core CI suites. So, it looks like the integration test setup may not work in Core CI, at least in some suites. Consider `ruby/irb` already has rather sophisticated test suite, I think it's better to skip the integration tests in core CI for now. https://github.com/ruby/irb/commit/6f49b4c108
2023-08-11[ruby/irb] Don't echo an expression's result when it ends with aStan Lo
semicolon (https://github.com/ruby/irb/pull/669) https://github.com/ruby/irb/commit/50185c2833
2023-08-10[ruby/zlib] Zlib.gunzip should not fail with utf-8 stringsSorah Fukumori
(https://github.com/ruby/zlib/pull/55) zstream_discard_input was encoding and character-aware when given input is user-provided, so this discards `len` chars instead of `len` bytes. Also Zlib.gunzip explains in its rdoc that it is equivalent with the following code, but this doesn't fail for UTF-8 String. ```ruby string = %w[1f8b0800c28000000003cb48cdc9c9070086a6103605000000].pack("H*").force_encoding('UTF-8') sio = StringIO.new(string) p gz.read #=> "hello" gz&.close p Zlib.gunzip(string) #=> Zlib::DataError ``` Reported and discovered by eagletmt at https://twitter.com/eagletmt/status/1689692467929694209 https://github.com/ruby/zlib/commit/c5e58bc62a
2023-08-11Fix range of `--backtrace-limit`Nobuyoshi Nakada
Also an option command line should have precedence over `RUBYOPT`. Notes: Merged: https://github.com/ruby/ruby/pull/8200
2023-08-10Deprecate Kernel#open and IO support for subprocess creation/forkingMike Dalessio
Deprecate Kernel#open and IO support for subprocess creation and forking. This deprecates subprocess creation and forking in - Kernel#open - URI.open - IO.binread - IO.foreach - IO.readlines - IO.read - IO.write This behavior is slated to be removed in Ruby 4.0 [Feature #19630] Notes: Merged: https://github.com/ruby/ruby/pull/7915
2023-08-09[ruby/irb] Skip nested IRB tests in Ruby Core CIStan Lo
(https://github.com/ruby/irb/pull/675) Sometimes the subprocess gets stuck in the nested IRB session until timed out. We don't have enough information to debug it yet, so skip the tests to unblock CI. https://github.com/ruby/irb/commit/606f18c80c