summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2025-12-09Remove unused local variables in test/ruby/test_io_buffer.rb (#15451)Étienne Barrié
2025-12-08Make `ruby_reset_leap_second_info` internalNobuyoshi Nakada
It is exported only for the extension library to test, but the method is no longer used since 29e31e72fb5a14194a78ec974c4ba56c33ad8d45.
2025-12-06Add error case tests for `File.path`Nobuyoshi Nakada
- for non-String argument - for NUL-contained argument - for ASCII-incompatible argument
2025-12-06Add support for `u128`, `U128`, `s128` and `S128` integers to `IO::Buffer`. ↵Samuel Williams
(#15399)
2025-12-05ZJIT: Account for when YJIT is on by default in test_zjit_enableAlan Wu
2025-12-05ZJIT: Skip GC.auto_compact test when unsupportedAlan Wu
2025-12-04Take VM lock in `class_switch_superclass` (#15356)Luke Gruber
Safe multi-ractor subclass list mutation We need to lock around mutation and accesses of a class's subclasses list. Unfortunately we also need to do this when creating singleton classes, as the singleton class does need to go into `super`'s subclasses list for CC invalidation purposes.
2025-12-05fix typo s/sharable/shareable/Koichi Sasada
2025-12-05Method and UnboundMethod can be sharableKoichi Sasada
with `RUBY_TYPED_FROZEN_SHAREABLE_NO_REC`, if the receiver object is shareable on Method objects.
2025-12-04Remove mismatched indentations warning (#15410)Étienne Barrié
2025-12-05Refine non-nil warnings for the deprecated variablesNobuyoshi Nakada
2025-12-05[Bug #21764] Propagate the encoding of ID to warningNobuyoshi Nakada
2025-12-02Avoid leaking fd in uminus_no_embed testJohn Hawthorn
2025-12-02ZJIT: Optimize GetIvar for non-T_OBJECTBenoit Daloze
* All Invariant::SingleRactorMode PatchPoint are replaced by assume_single_ractor_mode() to fix https://github.com/Shopify/ruby/issues/875 for SingleRactorMode patchpoints.
2025-12-01Test CC invalidation for singleton classes of objects (#15360)Luke Gruber
I made a recent change where all the tests passed but it turns out it was still wrong. We didn't have any tests for CC invalidation on singletons of objects that aren't classes or modules.
2025-12-01ZJIT: Optimize variadic cfunc `Send` calls into `CCallVariadic` (#14898)Stan Lo
ZJIT: Optimize variadic cfunc Send calls into CCallVariadic
2025-11-27Reorganize page documentations (#15154)Stan Lo
Re-organize page docs
2025-11-27Fix argument handling in `IO::Buffer#each_byte` (#15309)TOMITA Masahiro
The method incorrectly ignored its first argument and treated the second argument as offset and the third as count. This change makes the first argument be treated as offset and the second as count. Also fix incorrect block parameter in comments.
2025-11-26Ensure we don't dereference fields_obj as QundefJohn Hawthorn
We rely on the GC to clear this when the GC is run on another EC than the cache.
2025-11-26Clear fields obj when removingJohn Hawthorn
This fixes a bug where the gen_fields_cache could become invalid when the last ivar was removed. Also adds more assertions.
2025-11-26Revert miscommit at "Reset the cache variable before retrying"Nobuyoshi Nakada
This reverts commit 26a9e0b4e31f7b5a9cbd755e0a15823a8fa51bae partially.
2025-11-26Reset the cache variable before retryingNobuyoshi Nakada
2025-11-26Box: Add a test to drop the reference to a boxSatoshi Tagomori
2025-11-25vm_cc_new: don't assume `cme` is present.Jean Boussier
[Bug #21694] `vm_search_super_method` explictly calls `vm_cc_new` with `cme=NULL` when there is no super class.
2025-11-23Don't use non blocking pipes for RUBY_CRASH_REPORTPeter Zhu
[Bug #21703] RUBY_CRASH_REPORT does not work in some cases when shelling out on Linux. For example, given the following shell script dump.sh: #!/usr/bin/env bash cat > /tmp/crash And we see it fails like this: $ RUBY_CRASH_REPORT="|dump.sh" ruby -rfiddle -e "Fiddle::Pointer.new(1, 10)[0]" cat: -: Resource temporarily unavailable
2025-11-21Fix multiple bugs in `IO::Buffer.map` and update its documentation. (#15264)Alexander Bulancov
- Buffer's size did not account for offset when mapping the file, leading to possible crashes. - Size and offset were not checked properly, leading to many situations raising EINVAL errors with generic messages. - Documentation was wrong.
2025-11-20ZJIT: Change the output on redefined method tests to verify the new ↵Kevin Menard
definition is used
2025-11-20ZJIT: Update test names to use the same convention as the HIR testsKevin Menard
2025-11-20ZJIT: Add tests for `opt_newarray_send` with target methods redefinedKevin Menard
2025-11-20ZJIT: Compile the VM_OPT_NEWARRAY_SEND_HASH variant of opt_newarray_sendKevin Menard
2025-11-20Support backwards compatibility for Set subclassesJeremy Evans
For subclasses from Set, require `set/subclass_compatible`, and extend the subclass and include a module in it that makes it more backwards compatible with the pure Ruby Set implementation used before Ruby 4. The module included in the subclass contains a near-copy of the previous Set implementation, with the following changes: * Accesses to `@hash` are generally replaced with `super` calls. In some cases, they are replaced with a call to another instance method. * Some methods that only accessed `@hash` and nothing else are not defined, so they inherit behavior from core Set. * The previous `Set#divide` implementation is not used, to avoid depending on tsort. This fixes the following two issues: * [Bug #21375] Set[] does not call #initialize * [Bug #21396] Set#initialize should call Set#add on items passed in It should also fix the vast majority of backwards compatibility issues in other cases where code subclassed Set and depended on implementation details (such as which methods call which other methods). This does not affect Set internals, so Set itself remains fast. For users who want to subclass Set but do not need to worry about backwards compatibility, they can subclass from Set::CoreSet, a Set subclass that does not have the backward compatibility layer included.
2025-11-19Implement heap_final_slots in GC.stat_heapPeter Zhu
[Feature #20408]
2025-11-19Implement heap_free_slots in GC.stat_heapPeter Zhu
[Feature #20408]
2025-11-19Implement heap_live_slots in GC.stat_heapPeter Zhu
[Feature #20408]
2025-11-18Fix crash in optimal size for large T_OBJECTJohn Hawthorn
Previously any T_OBJECT with >= 94 IVARs would crash during compaction attempting to make an object too large to embed.
2025-11-18ZJIT: Inline setting Struct fieldsBenoit Daloze
* Add Insn::StoreField and Insn::WriteBarrier
2025-11-18ZJIT: add support for lazy `RubyVM::ZJIT.enable`Godfrey Chan
This implements Shopify#854: - Splits boot-time and enable-time initialization, tracks progress with `InitializationState` enum - Introduces `RubyVM::ZJIT.enable` Ruby method for enabling the JIT lazily, if not already enabled - Introduces `--zjit-disable` flag, which can be used alongside the other `--zjit-*` flags but prevents enabling the JIT at boot time - Adds ZJIT infra to support JIT hooks, but this is not currently exercised (Shopify/ruby#667) Left for future enhancements: - Support kwargs for overriding the CLI flags in `RubyVM::ZJIT.enable` Closes Shopify#854
2025-11-16Handle deeply nested capture variables syntax errKevin Newton
When there are nested capture variables inside of a pattern match that has an alternation pattern, it is a syntax error. Currently it only adds a syntax error when it is at the top level of the pattern.
2025-11-14ZJIT: Add tests for sending to methods with keyword args (#15183)Randy Stauner
2025-11-14[Feature #21572] Syntax error at capture in alternation patternNobuyoshi Nakada
Should fail even with `-c` option.
2025-11-14Adapt to Unicode directory changesMari Imaizumi
https://www.unicode.org/Public/emoji/ReadMe.txt > This directory contains data files for versions 1.0 to 16.0 of Unicode Emoji. > Starting with Unicode 17.0.0, the data files for Unicode Emoji are published in > https://www.unicode.org/Public/<version>/emoji/ > together with the related files in > https://www.unicode.org/Public/<version>/ucd/emoji/
2025-11-13Add size checks to Range#to_set and Enumerator#to_set [Bug #21654]Akinori Musha
These two class are most common sources of infinite sequences. This change should effectively prevent accidental infinite loops when calling to_set on them. [Bug #21513]
2025-11-13Revert "[Bug #21513] Raise on converting endless range to set"Akinori Musha
This reverts commit d4020dd5faf28486123853e7f00c36139fc07793, which introduced performance regression for objects like ActiveRecord::Relation by calling the costly #size method on them.
2025-11-13[Bug #21683] Respect reading encoding at `each_codepoint`Nobuyoshi Nakada
2025-11-12[Bug #21680] Fix (base**power_of_two).digits(base) bug (#15144)tomoya ishida
Fix wrong condition in base multiplying loop.
2025-11-11test_ractor.rb: Delete unnecessary GC.stress fiddlingAlan Wu
assert_ractor() runs in a subprocess.
2025-11-11[Bug #21666] Get rid of use of unspecified valuesNobuyoshi Nakada
2025-11-10ZJIT: Set cfp->sp on leaf calls with GC (#15137)Takashi Kokubun
Co-authored-by: Randy Stauner <randy@r4s6.net>
2025-11-10Add test for [Bug #21265]Alan Wu
The crash was fixed by a4dff09be79b52288a47658964d25e5aa84fc960 ("Fix resolving refined module-defined method"). I had a patch for this around for a few months but never merged it. Oops!
2025-11-11Revert "ns_subclasses refcount accesses need to be atomic (#15083)" (#15138)Luke Gruber
This reverts commit 2998c8d6b99ec49925ebea42198b29c3e27b34a7. We need to find a better way to fix this bug. Even with this refcount change, errors were still being seen in CI. For now we need to remove this failing test.