summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2024-03-17[Bug #20218] Reject keyword arguments in indexNobuyoshi Nakada
2024-03-17[Bug #19918] Reject block passing in indexNobuyoshi Nakada
2024-03-16Prefer the simple read/write `File` singleton methodsNobuyoshi Nakada
2024-03-16Prefer the simple read/write `File` singleton methodsNobuyoshi Nakada
2024-03-15Cover all warning categories by using `Warning.categories`Nobuyoshi Nakada
2024-03-15Test deprecation warning with `$;`Nobuyoshi Nakada
2024-03-14Ensure test suite is compatible with --frozen-string-literalJean Boussier
As preparation for https://bugs.ruby-lang.org/issues/20205 making sure the test suite is compatible with frozen string literals is making things easier.
2024-03-14`Exception#set_backtrace` accept arrays of `Backtrace::Location`Jean Boussier
[Feature #13557] Setting the backtrace with an array of strings is lossy. The resulting exception will return nil on `#backtrace_locations`. By accepting an array of `Backtrace::Location` instance, we can rebuild a `Backtrace` instance and have a fully functioning Exception. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2024-03-14[Feature #20244] Issue a single `Warning.warn` callNobuyoshi Nakada
Make the entire series of message lines a multiline string so that the `Warning.warn` hook can receive them in a single call.
2024-03-14[Feature #20244] Show the conflicting another chdir blockNobuyoshi Nakada
2024-03-14[Feature #20293] Add `Warning.categories`Nobuyoshi Nakada
2024-03-14[Bug #20307] Fix `Hash#update` to make frozen copy of string keysNobuyoshi Nakada
2024-03-14Chomp last punctuations from descriptions for `-h`Nobuyoshi Nakada
The following parts will not be shown for `-h` option. And not to reach 80 columns. Some terminal emulators (Windows command prompt at least) wrap the cursor to the next line when reaching the rightmost column, before exceeding.
2024-03-13Make special const and too complex shapes before T_OBJECT shapesPeter Zhu
2024-03-13Don't create per size pool shapes for non-T_OBJECTPeter Zhu
2024-03-12Skip a flaky GC.compact test for YJITTakashi Kokubun
This test has failed without YJIT too: https://rubyci.s3.amazonaws.com/debian11/ruby-master/log/20240301T063003Z.fail.html.gz However, it somehow fails more often on "YJIT Ubuntu / check RUSTC='rustc +1.58.0'" job. Nobody is actively looking into this issue, and it's most likely not a YJIT-specific issue, so let me silence this false positive until we start working on this.
2024-03-12Check what actually needs to be checkedTakashi Kokubun
RubyVM::YJIT is conditionally defined, depending on --enable-yjit. However, RubyVM::YJIT.enabled? is always defined as long as RubyVM::YJIT is defined, so it seems weird to check RubyVM::YJIT.enabled? instead of RubyVM::YJIT.
2024-03-12Use `assert_crash_report` in `test_crash_report_pipe`Nobuyoshi Nakada
Instead of using `assert_in_out_err` directly.
2024-03-12[Bug #20277] Remove stale `String` test conditionalsNobuyoshi Nakada
These instance variables for conditional execution have remained unchanged for nearly twenty years, since YARV merger.
2024-03-07Clear all refined CCs on reopening refinement modJohn Hawthorn
In cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732 we started using inline caches for refinements. However, we weren't clearing inline caches when defined on a reopened refinement module. Fixes [Bug #20246]
2024-03-07[Bug #20327] Do not count subsecond to calculate UTC offsetNobuyoshi Nakada
Assume that there will never be any time zones with UTC offsets that are subseconds. Historically, UTC offset has only been used down to the second.
2024-03-04Keep hidden local variables when dumping and loading iseqsJeremy Evans
Fixes [Bug #19975]
2024-03-04[Bug #20324] Uncomparable ranges are not overlappingNobuyoshi Nakada
2024-03-04Support NODE_ONCE for pattern matchingS-H-GAMELINKS
2024-03-04Disable callcc when ASAN is enabledKJ Tsanaktsidis
callcc's implementation is fundamentally incompatible with ASAN. Since callcc is deprecated and almost never used, it's probably OK to disable callcc when ruby is compiled with ASAN. [Bug #20273]
2024-03-01Correctly set anon_kwrest flag for def f(b: 1, **)Jeremy Evans
In cases where a method accepts both keywords and an anonymous keyword splat, the method was not marked as taking an anonymous keyword splat. Fix that in the compiler. Doing that broke handling of nil keyword splats in yjit, so update yjit to handle that. Add a test to check that calling a method that accepts both a keyword argument and an anonymous keyword splat does not modify a passed keyword splat hash. Move the anon_kwrest check from setup_parameters_complex to ignore_keyword_hash_p, and only use it if the keyword hash is already a hash. This should speed things up slightly as it avoids a check previously used for all callers of setup_parameters_complex. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-03-01YJIT: Support opt_invokebuiltin_delegate for leaf builtin (#10152)Takashi Kokubun
2024-03-01Make Struct memory leak test fasterJean Boussier
[Bug #20311] It times out on some platform, so we can reduce iterations. On my machine it completes in 250ms and RSS grows 8X.
2024-03-01Don't pin named structs defined in RubyJean Boussier
[Bug #20311] `rb_define_class_under` assumes it's called from C and that the reference might be held in a C global variable, so it adds the class to the VM root. In the case of `Struct.new('Name')` it's wasteful and make the struct immortal.
2024-03-01Use `File.open` and `File.write` instead of `Kernel#open`Nobuyoshi Nakada
2024-02-28Fix crash report path test on WindowsNobuyoshi Nakada
2024-02-28Fix to use `assert_crash_report` resultsNobuyoshi Nakada
2024-02-28Update regex patterns with rbinstall.rbHiroshi SHIBATA
2024-02-28Use dummy command for IO.popenHiroshi SHIBATA
2024-02-28Also ignore git ls-files command with IO.popen style for tmpdir.gemspec and ↵Hiroshi SHIBATA
tempfile.gemspec
2024-02-27[Bug #20302] Multiple refinements cannot be applied to the same moduleShugo Maeda
In the following code, the iclass tree of refinements in cref should be <iclass of Kernel@M2> -> <iclass of Kernel@M1> -> Kernel. However, the iclass tree was broken because of code for included modules of refinements in rb_using_refinement(). Refinement#include is now removed, so this commit removes such unnecessary code. ```ruby module M1 refine(Kernel) do def f1 = :f1 end end module M2 refine(Kernel) do def f2 = :f2 end end class Foo using M1 using M2 def test p f2 #=> :f2 p f1 # expected => :f1 # actual => undefined local variable or method 'f1' for an instance of Foo end end Foo.new.test ```
2024-02-27Add a failing test for https://bugs.ruby-lang.org/issues/20305.Fable Phippen
This bug demonstrates the issue I reported. It passes on commit https://github.com/ruby/ruby/commit/114e71d06280f9c57b9859ee4405ae89a989ddb6 but does not pass on commit (the immediate child of the above commit) https://github.com/ruby/ruby/commit/1d2d25dcadda0764f303183ac091d0c87b432566
2024-02-27Handle zero-like imaginary part as zero in to_r (#9581)Kenta Murata
Fixes [Bug #5179]
2024-02-26[Bug #20296] Fix the default assertion messageNobuyoshi Nakada
2024-02-26[Bug #20296] Refine the testNobuyoshi Nakada
2024-02-26[Bug #20296] Clear errinfo when `exception: false`Nobuyoshi Nakada
2024-02-23[Bug #20234] Fix segv when parsing begin statement in method definitioneileencodes
In a method definition, the `begin` may not have an `nd_body`. When that happens we get a null expr back from `last_expr_node` which causes a segv for the following examples: ```ruby def (begin;end).foo; end def (begin;else;end).foo; end def (begin;ensure;else;end).foo; end ``` In addition, I've added tests for other cases that weren't causing a segv but appeared untested.` Fixes https://bugs.ruby-lang.org/issues/20234
2024-02-23[Bug #20295] Fix SEGV when parsing invalid regexpyui-knk
2024-02-22Skip under_gc_compact_stress on s390x (#10073)Takashi Kokubun
2024-02-22[Bug #20292] Truncate embedded string to new capacityNobuyoshi Nakada
2024-02-22Cover all warning category optionsNobuyoshi Nakada
2024-02-21YJIT: Grab stack operands after SP change in String#byteslice (#10060)Alan Wu
Previously, `StackOperand`s caching `sp_offset` was held across a jit_prepare_call_with_gc(), which invalidates the offsets. With the right register allocation state, the canary overlapped with the old address of the receiver and YJIT clobbered the receiver writing the canary.
2024-02-21Re-enable test now that dump is all ASCIIKevin Newton
2024-02-22Ensure that exiting thread invokes end-of-life behaviour. (#10039)Samuel Williams
2024-02-20Add memory leak test for eval kwargsJohn Hawthorn