summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/rdoc] Fix fragile testsNobuyoshi Nakada2022-12-231-2/+2
| | | | | | | When the temporary path is long enough, the formatter may fold the path and may hit a hyphen at the end of line, and miscounted. https://github.com/ruby/rdoc/commit/5f46479543
* Debug for zlinux CI [ci skip]Nobuyoshi Nakada2022-12-231-2/+2
|
* [ruby/rdoc] Clean up home directories for each testNobuyoshi Nakada2022-12-233-12/+8
| | | | https://github.com/ruby/rdoc/commit/f067c174da
* [ruby/openssl] test/openssl/test_pkey.rb: allow failures in ↵Kazuki Yamaguchi2022-12-231-0/+5
| | | | | | | | | | | test_s_generate_parameters The root cause has been fixed by OpenSSL 3.0.6, but Ubuntu 22.04's OpenSSL package has not backported the patch yet. Reference: https://github.com/ruby/openssl/issues/492 https://github.com/ruby/openssl/commit/f2e2a5e5ed
* [ruby/openssl] pkey/ec: check private key validity with OpenSSL 3Joe Truba2022-12-233-0/+18
| | | | | | | | | | | | The behavior of EVP_PKEY_public_check changed between OpenSSL 1.1.1 and 3.0 so that it no longer validates the private key. Instead, private keys can be validated through EVP_PKEY_private_check and EVP_PKEY_pairwise_check. [ky: simplified condition to use either EVP_PKEY_check() or EVP_PKEY_public_check().] https://github.com/ruby/openssl/commit/e38a63ab3d
* [ruby/openssl] test/openssl/test_ssl.rb: do not run SSL tests if not availableKazuki Yamaguchi2022-12-233-3/+3
| | | | https://github.com/ruby/openssl/commit/a3d230d4e0
* [ruby/openssl] ssl: disable NPN support on LibreSSLKazuki Yamaguchi2022-12-231-15/+5
| | | | | | | | | | | | | | As noted in commit https://github.com/ruby/openssl/commit/a2ed156cc9f1 ("test/test_ssl: do not run NPN tests for LibreSSL >= 2.6.1", 2017-08-13), NPN is known not to work properly on LibreSSL. Disable NPN support on LibreSSL, whether OPENSSL_NO_NEXTPROTONEG is defined or not. NPN is less relevant today anyway. Let's also silence test suite when it's not available. https://github.com/ruby/openssl/commit/289f6e0e1f
* [ruby/openssl] test/openssl/test_asn1.rb: remove pend for unsupported ↵Kazuki Yamaguchi2022-12-231-8/+3
| | | | | | | | | | | | LibreSSL versions Commit https://github.com/ruby/openssl/commit/af895bc5596b ("asn1: avoid truncating OID in OpenSSL::ASN1::ObjectId#oid", 2016-12-15) added this test case. The OBJ_obj2txt() issue was fixed by LibreSSL 2.5.1 (released in 2017) and is no longer relevant today. https://github.com/ruby/openssl/commit/6a188f1a29
* [ruby/openssl] test/openssl/test_asn1.rb: skip failing tests on LibreSSL 3.6.0Kazuki Yamaguchi2022-12-231-3/+6
| | | | | | | | | | | | | LibreSSL 3.6.0 expects the seconds part in UTCTime and GeneralizedTime to be always present. LibreSSL 3.6.0 release note [1] says: > - The ASN.1 time parser has been refactored and rewritten using CBS. > It has been made stricter in that it now enforces the rules from > RFC 5280. [1] https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.6.0-relnotes.txt https://github.com/ruby/openssl/commit/bbc540fe83
* Clean intermediate source file in `TestMJIT#test_jit_failure` (#6994)Nobuyoshi Nakada2022-12-221-6/+8
|
* Always issue deprecation warning when calling Regexp.new with 3rd positional ↵Jeremy Evans2022-12-222-9/+33
| | | | | | | | | | | | | | argument Previously, only certain values of the 3rd argument triggered a deprecation warning. First step for fix for bug #18797. Support for the 3rd argument will be removed after the release of Ruby 3.2. Fix minor fallout discovered by the tests. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* Share argument parsing in `Regexp#initialize` and `Regexp.linear_time?`Nobuyoshi Nakada2022-12-221-0/+3
|
* Make sure TracePoint#binding returns nil for c_call/c_return eventsJeremy Evans2022-12-211-25/+45
| | | | This makes sure the method returns nil for these events, as described in NEWS, even if the TracePoint could create a binding.
* Add copy with changes functionality for Data objects (#6766)Ufuk Kayserilioglu2022-12-211-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements [Feature #19000] This commit adds copy with changes functionality for `Data` objects using a new method `Data#with`. Since Data objects are immutable, the only way to change them is by creating a copy. This PR adds a `with` method for `Data` class instances that optionally takes keyword arguments. If the `with` method is called with no arguments, the behaviour is the same as the `Kernel#dup` method, i.e. a new shallow copy is created with no field values changed. However, if keyword arguments are supplied to the `with` method, then the copy is created with the specified field values changed. For example: ```ruby Point = Data.define(:x, :y) point = Point.new(x: 1, y: 2) point.with(x: 3) # => #<data Point x: 3, y: 2> ``` Passing positional arguments to `with` or passing keyword arguments to it that do not correspond to any of the members of the Data class will raise an `ArgumentError`. Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
* Make Enumerartor.product return nil when called with a blockAkinori MUSHA2022-12-211-1/+1
|
* Make product consistently yield an array of N elements instead of N argumentsAkinori MUSHA2022-12-211-4/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inconsistency pointed out by @mame: ``` >> Enumerator.product([1], [2], [3]).to_a => [[1, 2, 3]] >> Enumerator.product([1], [2]).to_a => [[1, 2]] >> Enumerator.product([1]).to_a => [1] >> Enumerator.product().to_a => [nil] ``` Got fixed as follows: ``` >> Enumerator.product([1], [2], [3]).to_a => [[1, 2, 3]] >> Enumerator.product([1], [2]).to_a => [[1, 2]] >> Enumerator.product([1]).to_a => [[1]] >> Enumerator.product().to_a => [[]] ``` This was due to the nature of the N-argument funcall in Ruby.
* test/socket/test_addrinfo.rb: Suppress Errno::EACCES on WindowsNobuyoshi Nakada2022-12-211-2/+2
|
* [ruby/optparse] The encoding argument of `Regexp.new` has been ignored since 1.9Nobuyoshi Nakada2022-12-211-0/+3
| | | | https://github.com/ruby/optparse/commit/766f567405
* test_readline#test_without_tty: Use EnvUtil.rubybinSorah Fukumori2022-12-211-1/+3
| | | | | `ruby` is not always available in certain build environments and configure options. Choose appropriate command line using EnvUtil.
* Ensure Fiber storage is only accessed from the Fiber it belongs toBenoit Daloze2022-12-201-0/+12
|
* Use an experimental warning for Fiber#storage=Benoit Daloze2022-12-201-2/+5
|
* Never use the storage of another Fiber, that violates the whole designBenoit Daloze2022-12-201-2/+1
| | | | * See https://bugs.ruby-lang.org/issues/19078#note-30
* [Bug #19242] Prohibit circular causes to be loadedNobuyoshi Nakada2022-12-201-0/+12
|
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2022-12-202-5/+5
| | | | | | | | | | | | | | Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.48 to 0.9.52. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.48...v0.9.52) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
* [rubygems/rubygems] Bump rb-sys in ↵dependabot[bot]2022-12-202-5/+5
| | | | | | | | | | | | | | | | /test/rubygems/test_gem_ext_cargo_builder/custom_name Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.48 to 0.9.52. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.48...v0.9.52) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
* [rubygems/rubygems] Cleanup intermediate artifacts after installing built ↵Eloy Espinaco2022-12-201-0/+35
| | | | | | extensions https://github.com/rubygems/rubygems/commit/98b6a959bd
* [rubygems/rubygems] Use better name for variableDavid Rodríguez2022-12-201-3/+3
| | | | | | | | The installed file not always have the `.so` extension. https://github.com/rubygems/rubygems/commit/6f6681bcb9 Co-authored-by: Eloy Espinaco <eloyesp@gmail.com>
* [rubygems/rubygems] Fix tests checking intermediate filesEloy Espinaco2022-12-202-2/+2
| | | | | | | Some tests check that the shared objects are actually installed, but checking an intermediate build file instead of the installed one. https://github.com/rubygems/rubygems/commit/ad526073b0
* Prevent a "method redefined" warningYusuke Endoh2022-12-171-0/+3
|
* Prevent warning "assigned but unused variable - initial_shape"Yusuke Endoh2022-12-171-1/+1
|
* [ruby/irb] PTY module is platform dependentNobuyoshi Nakada2022-12-191-1/+6
| | | | https://github.com/ruby/irb/commit/dbb3dc72ff
* Add tests for `Queue#pop` with fiber scheduler. (#6953)Samuel Williams2022-12-171-0/+42
|
* Clean up Ruby Shape APIJemma Issroff2022-12-161-1/+1
| | | | | | | Make printing shapes better, use a struct instead of specific methods for each field on a shape. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
* [Feature #18033] Parse more strictly conformant with ISO-8601Nobuyoshi Nakada2022-12-161-3/+7
| | | | | * 4-digits or more is required as year * Minutes and seconds parts are not ommittable
* [Feature #18033] Add `precision:` optionNobuyoshi Nakada2022-12-161-0/+3
| | | | | Which limits the precision of subsecond. Defaulted to 9, that means nanosecond.
* [Feature #18033] More strict checksNobuyoshi Nakada2022-12-161-0/+36
|
* [Feature #18033] Make Time.new parse time stringsNobuyoshi Nakada2022-12-161-0/+21
| | | | | `Time.new` now parses strings such as the result of `Time#inspect` and restricted ISO-8601 formats.
* Unconditionally warn "unknown pack/unpack directive"Yusuke Endoh2022-12-161-10/+2
| | | | [Bug #19150]
* Reject keyword arguments given to Enumerator::Product.newAkinori MUSHA2022-12-161-0/+8
| | | | The use of keyword arguments should be reserved for future extension.
* [ruby/irb] Prefer to use File.open instead of Kernel.openHiroshi SHIBATA2022-12-161-2/+2
| | | | https://github.com/ruby/irb/commit/ed9e435a6b
* fixed encoding tableKoichi Sasada2022-12-161-1/+15
| | | | | This reduces global lock acquiring for reading. https://bugs.ruby-lang.org/issues/18949
* YJIT: Fix `obj.send(:call)`Alan Wu2022-12-151-0/+6
| | | | | | | | | All the method call types need to handle argument shifting in case they're called by `.send`, and we weren't handling that in `OPTIMIZED_METHOD_TYPE_CALL`. Lack of shifting caused the stack size assertion in gen_leave() to fail. Discovered by Rails CI: https://buildkite.com/rails/rails/builds/91705#018516c4-f8f8-469e-bc2d-ddeb25ca8317/1920-2067 Diagnosed with help from `@eileencodes` and `@k0kubun`.
* Indicate if a shape is too_complex in ObjectSpace#dumpJemma Issroff2022-12-151-0/+29
|
* Fix Object Movement allocation in GCMatt Valentine-House2022-12-151-0/+3
| | | | | | | | | | | | | | | | | | | When moving Objects between size pools we have to assign a new shape. This happened during updating references - we tried to create a new shape tree that mirrored the existing tree, but based on the root shape of the new size pool. This causes allocations to happen if the new tree doesn't already exist, potentially triggering a GC, during GC. This commit changes object movement to look for a pre-existing new tree during object movement, and if that tree does not exist, we don't move the object to the new pool. This allows us to remove the shape allocation from update references. Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
* Transition complex objects to "too complex" shapeJemma Issroff2022-12-151-0/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an object becomes "too complex" (in other words it has too many variations in the shape tree), we transition it to use a "too complex" shape and use a hash for storing instance variables. Without this patch, there were rare cases where shape tree growth could "explode" and cause performance degradation on what would otherwise have been cached fast paths. This patch puts a limit on shape tree growth, and gracefully degrades in the rare case where there could be a factorial growth in the shape tree. For example: ```ruby class NG; end HUGE_NUMBER.times do NG.new.instance_variable_set(:"@unique_ivar_#{_1}", 1) end ``` We consider objects to be "too complex" when the object's class has more than SHAPE_MAX_VARIATIONS (currently 8) leaf nodes in the shape tree and the object introduces a new variation (a new leaf node) associated with that class. For example, new variations on instances of the following class would be considered "too complex" because those instances create more than 8 leaves in the shape tree: ```ruby class Foo; end 9.times { Foo.new.instance_variable_set(":@uniq_#{_1}", 1) } ``` However, the following class is *not* too complex because it only has one leaf in the shape tree: ```ruby class Foo def initialize @a = @b = @c = @d = @e = @f = @g = @h = @i = nil end end 9.times { Foo.new } `` This case is rare, so we don't expect this change to impact performance of most applications, but it needs to be handled. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
* Revert "Fix Object Movement allocation in GC"Peter Zhu2022-12-151-3/+0
| | | | | | This reverts commit 9c54466e299aa91af225bc2d92a3d7755730948f. We're seeing crashes in Shopify CI after this commit.
* Fix Object Movement allocation in GCMatt Valentine-House2022-12-151-0/+3
| | | | | | | | | | | | | | | | | | | When moving Objects between size pools we have to assign a new shape. This happened during updating references - we tried to create a new shape tree that mirrored the existing tree, but based on the root shape of the new size pool. This causes allocations to happen if the new tree doesn't already exist, potentially triggering a GC, during GC. This commit changes object movement to look for a pre-existing new tree during object movement, and if that tree does not exist, we don't move the object to the new pool. This allows us to remove the shape allocation from update references. Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
* Disallow mixed usage of ... and */**Shugo Maeda2022-12-152-29/+7
| | | | [Feature #19134]
* Remove `require 'io/wait'` where it's no longer necessary. (#6932)Samuel Williams2022-12-155-8/+3
| | | | | | | * Remove `require 'io/wait'` as it's part of core now. * Update ruby specs using version gates. * Add note about why it's conditional.
* [rubygems/rubygems] Clean up Indexer build files in testsNobuyoshi Nakada2022-12-141-20/+39
| | | | https://github.com/rubygems/rubygems/commit/5479d99a1d