summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
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
2021-10-20Fix tests with cppflags=-DYJIT_FORCE_ENABLETakashi Kokubun
https://github.com/ko1/build-ruby/commit/0dbd95c6250594b6ddadc3c4424b071704083187
2021-10-20Improve YJIT command line option parsingAlan Wu
Previously, options such as "--yjit123" would enable YJIT. Additionally, the error message for argument parsing mentioned "--jit-..." instead of "--yjit-...".
2021-10-20Show +YJIT in version string and RUBY_DESCRIPTIONAlan Wu
There might be code out there that expect `ruby -v` to print only one line. Since MJIT shows +JIT in `ruby -v` and RUBY_DESCRIPTION, let's show +YJIT. The crash report doesn't show anything about MJIT, so adjust the test. The "test_ruby_version" test was unaware of RUBY_YJIT_ENABLE and so was failing when the variable is set and inherited into the children processes it spawns. Explicitly unset the variable in the test.
2021-10-20Implement getclassvariable in yjiteileencodes
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-10-20Add a slowpath for opt_getinlinecacheAlan Wu
Before this change, when we encounter a constant cache that is specific to a lexical scope, we unconditionally exit. This change falls back to the interpreter's cache in this situation. This should help constant expressions in `class << self`, which is popular at Shopify due to the style guide. This change relies on the cache being warm while compiling to detect the need for checking the lexical scope for simplicity.
2021-10-20Fix excessive invalidation for opt_getinlinecacheAlan Wu
YJIT expects the VM to invalidate opt_getinlinecache when updating the constant cache, and the invalidation used to happen even when YJIT can't use the cached value. Once the first invalidation happens, the block for opt_getinlinecache becomes a stub. When the stub is hit, YJIT fails to compile the instruction as the cache is not usable. The stub becomes a block that exits for opt_getinlinecache which can be invalidated again. Some workloads that bust the interpreter's constant cache can create an invalidation loop with this behavior. Check if the cache is usable become doing invalidation to fix this problem. In the test harness, evaluate the test script in a lambda instead of a proc so `return` doesn't return out of the harness.
2021-10-20Implement invokebuiltinJohn Hawthorn
2021-10-20Add test for setlocalJohn Hawthorn
2021-10-20Specialize based on types of opt_asetJohn Hawthorn
2021-10-20Add tests against side exits for non-fixnumJohn Hawthorn
2021-10-20Revert "disable yjit when testing mjit"Aaron Patterson
This reverts commit e8622ce5c0a09c7213e4d536ddd0ef3ea68377ef.
2021-10-20Implement getspecialJohn Hawthorn
2021-10-20Add tests against opt_eq side exitsJohn Hawthorn
2021-10-20disable yjit when testing mjitAaron Patterson
2021-10-20Exit when the object is frozenAaron Patterson
Exit when the object is frozen, also add tests
2021-10-20Allow calling variadic cfuncs with many argsJohn Hawthorn
We have a check to ensure we don't have to push args on the stack to call a cfunc with many args. However we never need to use the stack for variadic cfuncs, so we shouldn't care about the number of arguments.
2021-10-20Allow special case of expandarray with nilJohn Hawthorn
2021-10-20Implement newrangeJohn Hawthorn
2021-10-20Implement invokesuper using cfp->ep[ME] checkJohn Hawthorn
This fixes and re-enables invokesuper, replacing the existing guards with a guard on the method entry for the EP.
2021-10-20Avoid immediate side exits in checktypeJohn Hawthorn
Previously checktype only supported heap objects, however it's not uncommon to receive an immediate, for example when string interpolating a Symbol or Integer.
2021-10-20Add toregexp to yjiteileencodes
The FIXME is there so we remember to investigate why insns clears the temporary array. Is this necessary? If it's not we can remove it from both. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-10-20Implement putspecialobjectJohn Hawthorn
2021-10-20Add opt_regexpmatch2John Hawthorn
2021-10-20Implement tostring instruction for yjiteileencodes
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>