summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-10-28Fix leap day with UTC offset [Bug #18274]Nobuyoshi Nakada
`struct vtm::year` is a Ruby integer instance, but not a C integer type. Notes: Merged: https://github.com/ruby/ruby/pull/5041
2021-10-27YJIT: move --yjit-stats at_exit call into RubyAlan Wu
This change fixes `-v --yjit-stats`. Previously in this situation, YJIT._print_stats wasn't defined as yjit.rb is not evaluated when there is only "-v" and no Ruby code to run. Notes: Merged: https://github.com/ruby/ruby/pull/5022
2021-10-27Expect multi-line -v output for -DRUBY_DEVEL in testsAlan Wu
On -DRUBY_DEVEL builds, `ruby -v` can print extra info about the last commit on a separate line, breaking some tests that expect a single line. Assert only the first line instead. Notes: Merged: https://github.com/ruby/ruby/pull/5022
2021-10-27Fix indentation in testAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/5022
2021-10-27YJIT: Support newhash with values (#5029)John Hawthorn
* YJIT: Implement newhash with values * YJIT: Add test of duphash * Fix compilation on macos/clang Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2021-10-27[ruby/error_highlight] Make the formatter mechanism support RactorYusuke Endoh
Now the formatter configuration is per Ractor. DefaultFormatter is used if not set. DefaultFormatter#message_for is now a class method to allow sub-Ractors to call the method. https://github.com/ruby/error_highlight/commit/9fbaa8ab7c
2021-10-26pack.c: add an offset argument to unpack and unpack1Jean Boussier
[Feature #18254] This is useful to avoid repeteadly copying strings when parsing binary formats
2021-10-26Add Class#descendantsJeremy Evans
Doesn't include receiver or singleton classes. Implements [Feature #14394] Co-authored-by: fatkodima <fatkodima123@gmail.com> Co-authored-by: Benoit Daloze <eregontp@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/4974 Merged-By: jeremyevans <code@jeremyevans.net>
2021-10-26[Bug #18264] Fix memory leak in TracePointPeter Zhu
TracePoint leaks memory because it allocates a `rb_tp_t` struct without ever freeing it (it is created with `RUBY_TYPED_NEVER_FREE`). Notes: Merged: https://github.com/ruby/ruby/pull/5008
2021-10-26Make the metaclass of Refinement explicitlyShugo Maeda
Otherwise, singleton methods of Module are not inherited unless Refinement.singleton_class is called.
2021-10-26fix random EBADF problemKoichi Sasada
```ruby r, w = IO.pipe r.close IO.for_fd(w.fileno).close ``` This code closes a file descriptor `w.fileno`, but `w` doesn't know the closing. Another code can open same file descriptor with opening file (`f`). After that, the `w` will GCed and `w.fileno` is closed again, and `f.fileno` is closed too, so IO operations for `f` (`f.close`) will cause EBADF. To fix this issue, do this test in another process.
2021-10-26[rubygems/rubygems] Add support to build and sign certificates with multiple ↵Jenny Shen
key algorithms https://github.com/rubygems/rubygems/commit/967876f15d Co-Authored-By: Frederik Dudzik <frederik.dudzik@shopify.com>
2021-10-25[Feature #18239] Implement VWA for stringsPeter Zhu
This commit adds support for embedded strings with variable capacity and uses Variable Width Allocation to allocate strings. Notes: Merged: https://github.com/ruby/ruby/pull/4933
2021-10-25Strip out YJIT at build time when unsupported or disabled (#5003)Alan Wu
In an effort to minimize build issues on non x64 platforms, we can decide at build time to not build the bulk of YJIT. This should fix obscure build errors like this one on riscv64: yjit_asm.c:137:(.text+0x3fa): relocation truncated to fit: R_RISCV_PCREL_HI20 against `alloc_exec_mem' We also don't need to bulid YJIT on `--disable-jit-support` builds. One wrinkle to this is that the YJIT Ruby module will not be defined when YJIT is stripped from the build. I think that's a fair change as it's only meant to be used for YJIT development. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2021-10-25test/ruby/test_jit.rb: Add a test for checkmatch insnYusuke Endoh
2021-10-25test/ruby/test_jit.rb: Print a hint at exit of the original processYusuke Endoh
Otherwise, the hint is printed whenever fork is called. http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20211025T093004Z.log.html.gz ``` [20244/21156] TestThread#test_fork_while_lockedyou may want to add tests for following insns, when you have a chance: checkmatch you may want to add tests for following insns, when you have a chance: checkmatch you may want to add tests for following insns, when you have a chance: checkmatch = 0.19 s ```
2021-10-25[rubygems/rubygems] Avoid loading the `digest` gem unnecessarilyDavid Rodriguez
OpenSSL includes what we need. https://github.com/rubygems/rubygems/commit/955f3b72ca
2021-10-25process.c: Add Process._fork (#5017)Yusuke Endoh
* process.c: Add Process._fork This API is supposed for application monitoring libraries to hook fork event. [Feature #17795] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged-By: mame <mame@ruby-lang.org>
2021-10-25test/ruby/test_rubyvm.rb: prevent "assigned but unused variable" warningsYusuke Endoh
http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20211025T093004Z.log.html.gz ``` [ 4896/21159] TestRubyVM#test_keep_script_lines(none):3: warning: assigned but unused variable - b (none):6: warning: assigned but unused variable - c (none):1: warning: assigned but unused variable - a <compiled>:3: warning: assigned but unused variable - b (none):3: warning: assigned but unused variable - b (none):6: warning: assigned but unused variable - c (none):1: warning: assigned but unused variable - a <compiled>:3: warning: assigned but unused variable - b ```
2021-10-25test/ruby/test_refinement.rb: Prevent deprecation warnings during testYusuke Endoh
http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20211025T093004Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:777: warning: Refinement#include is deprecated and will be removed in Ruby 3.2 /home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:840: warning: Refinement#prepend is deprecated and will be removed in Ruby 3.2 /home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:2620: warning: Refinement#include is deprecated and will be removed in Ruby 3.2 ```
2021-10-25test/ruby/test_marshal.rb: Prevent "assigned but unused variable" warningYusuke Endoh
http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20211025T093004Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_marshal.rb:925: warning: assigned but unused variable - objects ```
2021-10-25Make Coverage suspendable (#4856)Yusuke Endoh
* Make Coverage suspendable Add `Coverage.suspend`, `Coverage.resume` and some methods. [Feature #18176] [ruby-core:105321] Notes: Merged-By: mame <mame@ruby-lang.org>
2021-10-25Fix `Enumerable#each_cons` and `Enumerable#each_slice` to return a receiverTSUYUSATO Kitsune
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/1509 Merged-By: nobu <nobu@ruby-lang.org>
2021-10-25[ruby/openssl] bn: make BN.pseudo_rand{,_range} an alias of BN.rand{,_range}Kazuki Yamaguchi
BN_pseudo_rand() and BN_pseudo_rand_range() are deprecated in OpenSSL 3.0. Since they are identical to their non-'pseudo' version anyway, let's make them alias. https://github.com/ruby/openssl/commit/2d34e85ddf
2021-10-24[ruby/csv] Add support for Ractor (https://github.com/ruby/csv/pull/218)rm155
https://github.com/ruby/csv/commit/a802690e11 Notes: Merged: https://github.com/ruby/ruby/pull/5010
2021-10-24[ruby/csv] CSV(): Add support for Ruby 3 (https://github.com/ruby/csv/pull/215)Anthony Hernandez
The implementation of the `CSV` shortcut method is broken in Ruby 3 for calls that look like this: ```ruby CSV(write_stream, col_sep: "|", headers: headers, write_headers: true) do |csv| ... end ``` The above will result in the following error when the `CSV` method attempts to pass on arguments to `CSV#instance`: ``` ArgumentError: wrong number of arguments (given 2, expected 0..1) ``` The issue is due to the changes in Ruby 3 relating to positional & keyword arguments. This commit updates the `CSV()` shortcut implementation to work with Ruby 3, and also updates the documentation for the shortcut method. https://github.com/ruby/csv/commit/310dee45fa Notes: Merged: https://github.com/ruby/ruby/pull/5010
2021-10-24[ruby/csv] Changed line ending handling to consider the combination \r\n as ↵Joakim Antman
a single entry when row is faulty (https://github.com/ruby/csv/pull/220) https://github.com/ruby/csv/commit/29cef9ea9d Notes: Merged: https://github.com/ruby/ruby/pull/5010
2021-10-23[ruby/openssl] test/openssl/test_ssl: use assert_raise in test_bad_socketKazuki Yamaguchi
The Ruby tree disallows assert_raises. https://github.com/ruby/openssl/commit/9b4f761e74
2021-10-23[ruby/openssl] Raise an exception if the IO object passed to SSLSocket isn't ↵Aaron Patterson
a file SSLSocket#connect eventually calls `GetOpenFile` in order to get the underlying file descriptor for the IO object passed in on initialization. `GetOpenFile` assumes that the Ruby object passed in is a T_FILE object and just casts it to a T_FILE without any checks. If you pass an object that *isn't* a T_FILE to that function, the program will segv. Since we assume the IO object is a file in the `connect` method, this commit adds a `CheckType` in the initialize method to ensure that the IO object is actually a T_FILE. If the object *isn't* a T_FILE, this class will segv on `connect`, so I think this is a backwards compatible change. https://github.com/ruby/openssl/commit/919fa44ec2
2021-10-23[ruby/openssl] test/openssl/test_pkey_rsa: disable test_no_private_exp on ↵Kazuki Yamaguchi
OpenSSL 3.0 OpenSSL::PKey::RSA#set_key does not exist when built with OpenSSL 3.0, so it is not possible to create an RSA object with incomplete state. https://github.com/ruby/openssl/commit/ca03c9c070
2021-10-23[ruby/openssl] test/openssl/test_pkey: use EC keys for ↵Kazuki Yamaguchi
PKey.generate_parameters tests OpenSSL 3.0 refuses to generate DSA parameters shorter than 2048 bits, but generating 2048 bits parameters takes very long time. Let's use EC in these test cases instead. https://github.com/ruby/openssl/commit/c732387ee5
2021-10-23[ruby/openssl] test/openssl/test_ssl: fix illegal SAN extensionKazuki Yamaguchi
A certificate can only have one SubjectAltName extension. OpenSSL 3.0 performs a stricter validation and certificates containing multiple SANs will be rejected. https://github.com/ruby/openssl/commit/558cfbe5f5
2021-10-23[ruby/openssl] test/openssl/test_pkcs12: fix test failures with OpenSSL 3.0Kazuki Yamaguchi
OpenSSL's PKCS12_create() by default uses pbewithSHAAnd40BitRC2-CBC for encryption of the certificates. However, in OpenSSL 3.0, the algorithm is part of the legacy provider and is not enabled by default. Specify another algorithm that is still in the default provider for these test cases. https://github.com/ruby/openssl/commit/998406d18f
2021-10-23[ruby/openssl] test/openssl/test_ssl: relax regex to match OpenSSL's error ↵Kazuki Yamaguchi
message OpenSSL 3.0 slightly changed the error message for a certificate verification failure when an untrusted self-signed certificate is found in the chain. https://github.com/ruby/openssl/commit/b5a0a19850
2021-10-23[ruby/openssl] test/openssl/test_digest: do not test constants for legacy ↵Kazuki Yamaguchi
algorithms Remove availability test for MD4 and RIPEMD160 as they are considered legacy and may be missing depending on the compile-time options of OpenSSL. OpenSSL 3.0 by default disables them. https://github.com/ruby/openssl/commit/a3e59f4c2e
2021-10-23[ruby/openssl] test/openssl/test_ssl: assume ECC supportKazuki Yamaguchi
Disabling ECC support of OpenSSL is impractical nowadays. We still try to have the C extension compile on no-ec builds (as well as no-dh or no-engine, etc.) as long as we can, but keeping test cases for such an extreme scenario is not worth the effort. https://github.com/ruby/openssl/commit/2cd01d4676
2021-10-23[ruby/openssl] test/openssl/test_ssl: assume TLS 1.2 supportKazuki Yamaguchi
Current versions of OpenSSL and LibreSSL all support TLS 1.2, so there is no need for checking the availability. https://github.com/ruby/openssl/commit/a175a41529
2021-10-23[ruby/openssl] test/openssl/utils: remove dup_public helper methodKazuki Yamaguchi
It uses deprecated PKey::{RSA,DSA,DH}#set_* methods, which will not work with OpenSSL 3.0. The same can easily be achieved using PKey#public_to_der regardless of the key kind. https://github.com/ruby/openssl/commit/7b66eaa2db
2021-10-22Disable did_you_mean in TestPatternMatchingYuki Nishijima
2021-10-22Remove the test for DYM's verbose formatterYuki Nishijima
2021-10-22Sync did_you_mean againYuki Nishijima
2021-10-22Revert "Sync did_you_mean"Yuki Nishijima
This reverts commit e22d293e06966733e71a7fd9725eee06c03d0177.
2021-10-22Sync did_you_meanYuki Nishijima
2021-10-22'uri/https' is neededKoichi Sasada
`URI.parse('https://a.b.c/')` needs 'uri/https'.
2021-10-22[ruby/uri] URI#HTTP#origin and URI#HTTP#authority ↵Tiago
(https://github.com/ruby/uri/pull/30) https://github.com/ruby/uri/commit/bf13946c32 Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
2021-10-22Import bigdecimal-3.1.0.devHiroshi SHIBATA
2021-10-21Deprecate include/prepend in refinements and add Refinement#import_methods ↵Shugo Maeda
instead Refinement#import_methods imports methods from modules. Unlike Module#include, it copies methods and adds them into the refinement, so the refinement is activated in the imported methods. [Bug #17429] [ruby-core:101639]
2021-10-21freeze (make shareable) script_linesKoichi Sasada
Notes: Merged: https://github.com/ruby/ruby/pull/4913
2021-10-21`RubyVM.keep_script_lines`Koichi Sasada
`RubyVM.keep_script_lines` enables to keep script lines for each ISeq and AST. This feature is for debugger/REPL support. ```ruby RubyVM.keep_script_lines = true RubyVM::keep_script_lines = true eval("def foo = nil\ndef bar = nil") pp RubyVM::InstructionSequence.of(method(:foo)).script_lines ``` Notes: Merged: https://github.com/ruby/ruby/pull/4913
2021-10-20Fix test_version again for RUBY_YJIT_ENABLE=1Takashi Kokubun