summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-08-26Remove `opt_aref_with` and `opt_aset_with`Aaron Patterson
When these instructions were introduced it was common to read from a hash with mutable string literals. However, these days, I think these instructions are fairly rare. I tested this with the lobsters benchmark, and saw no difference in speed. In order to be sure, I tracked down every use of this instruction in the lobsters benchmark, and there were only 4 places where it was used. Additionally, this patch fixes a case where "chilled strings" should emit a warning but they don't. ```ruby class Foo def self.[](x)= x.gsub!(/hello/, "hi") end Foo["hello world"] ``` Removing these instructions shows this warning: ``` > ./miniruby -vw test.rb ruby 3.5.0dev (2025-08-25T21:36:50Z rm-opt_aref_with dca08e286c) +PRISM [arm64-darwin24] test.rb:2: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information) ``` [Feature #21553]
2025-08-26Exclude a couple tests failing on JRuby for multiple reasonsBenoit Daloze
* https://github.com/jruby/jruby/issues/8972 but also at least 2 more incompatibilities.
2025-08-26Fix Pathname#lutime test and add the method backBenoit Daloze
2025-08-26Fix TestPathname#has_symlink? it was returning false on LinuxBenoit Daloze
2025-08-26Simplified assertionHiroshi SHIBATA
2025-08-26Revert "Omit extra allocation of Array object in Windows platform temporary"Benoit Daloze
This reverts commit 6ab2cd0f69ff1591db3a0011b73d3b26a9a69412.
2025-08-25Omit extra allocation of Array object in Windows platform temporaryHiroshi SHIBATA
2025-08-25Import https://github.com/ruby/pathname/pull/57Hiroshi SHIBATA
2025-08-22ZJIT: Spill whole FrameState in `Insn::SendWithoutBlock`Alan Wu
Previously, we only spilled the arguments necessary for the particular send. In case the callee raises and a rescue resumes the ISEQ, that did not present a complete stack state. E.g. in `[1, (raise rescue 2)]` the raise send only spills `self`, when `1` also needs to be spilled. Spill the whole stack. Adjust parsing for `opt_aref_with` since the key argument for the send now needs to be described by the frame state of the send. This changes the contract for `Insn::SendWithoutBlock` to use arguments from the interpreter stack as described by its frame state.
2025-08-22ZJIT: Allow querying a single ZJIT stat (#14309)Takashi Kokubun
* ZJIT: Add RubyVM::ZJIT.stats_enabled? * ZJIT: Allow querying a single ZJIT stat
2025-08-22Fixes to encoding/transcoding for ractors.Luke Gruber
Not all ractor-related encoding issues were fixed by 1afc07e815051e2f73493f055f2130cb642ba12a. I found more by running my test-all branch with 3 ractors for each test.
2025-08-22ZJIT: Temporarily downgrade assert_compiles to assert_runsMax Bernstein
2025-08-21ZJIT: Fill nils before function_stub_hit exit (#14294)Takashi Kokubun
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Co-authored-by: Max Bernstein <ruby@bernsteinbear.com> Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-08-21Adjust snt < max_cpu calculationJohn Hawthorn
[Bug #20146] Previously we dealt with the main Ractor not being enabled for M:N by incrementing snt_cnt++. This worked for comparing against ractor count, but meant that we always had one less SNT than was specified by RUBY_MAX_CPU. This was notably a problem for RUBY_MAX_CPU=1, which would cause Ractors to hang. This commit instead of adjusting snt, adjusts a "schedulable_ractor_cnt". This way snt_cnt will actually reach RUBY_MAX_CPU.
2025-08-22Do not respect ruby2_keywords on method/proc with post argumentsJeremy Evans
Previously, ruby2_keywords could be used on a method or proc with post arguments, but I don't think the behavior is desired: ```ruby def a(*c, **kw) [c, kw] end def b(*a, b) a(*a, b) end ruby2_keywords(:b) b({foo: 1}, bar: 1) ``` This changes ruby2_keywords to emit a warning and not set the flag on a method/proc with post arguments. While here, fix the ruby2_keywords specs for warnings, since they weren't testing what they should be testing. They all warned because the method didn't accept a rest argument, not because it accepted a keyword or keyword rest argument.
2025-08-21Remove unused SPECIAL_CONST_SHAPE_IDÉtienne Barrié
Its usage was removed in 306d50811dd060d876d1eb364a0d5e6106f5e4f1.
2025-08-21variable.c: handle cleared fields_obj in genfields cacheJean Boussier
[Bug #21547] Followup: https://github.com/ruby/ruby/pull/14201 When adding an instance variable and the IMEMO/fields need to be larger, we allocate a new one and clear the old one. Since the old one may still be in other ec's cache, on a hit we must check the IMEMO/fields isn't a stale one.
2025-08-21Add `Math.log1p` and `Math.expm1`Yusuke Endoh
This commit adds two new methods to the `Math` module: * `Math.log1p(x)`: Computes `Math.log(x + 1)` * `Math.expm1(x)`: Computes `Math.exp(x) - 1` These methods are often more accurate than the straightforward computation, especially when `x` is close to zero. The corresponding functions, `log1p` and `expm1`, are defined in the C99 standard math library. [Feature #21527]
2025-08-19ZJIT: Prepare for rb_range_new() calling <=>Alan Wu
gen_prepare_call_with_gc() was not enough because of the rb_funcall() usage in range_init(). Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Max Bernstein <rubybugs@bernsteinbear.com>
2025-08-19Fix special consts unit tests for i686 (#14271)Max Bernstein
32-bit platforms do not have flonum and something about the static symbol test was flaky.
2025-08-19ZJIT: Compile toregexp (#14200)Daniel Colson
`toregexp` is fairly similar to `concatstrings`, so this commit extracts a helper for pushing and popping operands on the native stack. There's probably opportunity to move some of this into lir (e.g. Alan suggested a push_many that could use STP on ARM to push 2 at a time), but I might save that for another day.
2025-08-19Change TestString#test_ascii_incomat_inspect to use ↵Peter Zhu
EnvUtil.with_default_external
2025-08-19Change TestM17N#test_object_inspect_external to use ↵Peter Zhu
EnvUtil.with_default_external
2025-08-19Change TestM17N#test_object_utf16_32_inspect to use ↵Peter Zhu
EnvUtil.with_default_external
2025-08-19Change TestM17N#test_string_inspect_encoding to use ↵Peter Zhu
EnvUtil.with_default_external
2025-08-19Change TestHash#test_inspect to use EnvUtil.with_default_externalPeter Zhu
2025-08-18Don't allow looking at the shape ID of immediates (#14266)Max Bernstein
It only makes sense for heap objects.
2025-08-18Increase timeout on slow tests (#14264)Max Bernstein
2025-08-18ZJIT: Temporarily disable buggy defined? codegenMax Bernstein
2025-08-18ZJIT: Codegen for NewHash (#14059)Donghee Na
This is my first contribution to ZJIT. Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
2025-08-18Fix typosDouglas Eichelberger
2025-08-18[rubygems/rubygems] Use spaces around optional parameter valuesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b58829a868
2025-08-18[rubygems/rubygems] Don't worry about missing Makefile.Samuel Williams
https://github.com/rubygems/rubygems/commit/0e92346d88
2025-08-15Fix tests using assert_raise_with_message on US-ASCII systemsPeter Zhu
On systems where the Encoding.default_internal defaults to US-ASCII instead of UTF-8, some tests using assert_raise_with_message can fail since it no longer changes Encoding.default_internal in 79f5202. This tests explicitly uses EnvUtil.with_default_internal on systems where these tests fail.
2025-08-15Skip an unstable Ractor test for windows (#14247)Takashi Kokubun
https://github.com/ruby/ruby/actions/runs/16995599804/job/48185434078?pr=14242
2025-08-15ZJIT: Implement getspecial (#13642)Eileen
ZJIT: Implement getspecial in ZJIT Adds support for the getspecial instruction in zjit. We split getspecial into two instructions, one for special symbols (`$&`, $'`, etc) and one for special backrefs (`$1`, `$2`, etc). Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-08-15Relax a delta for an unstable test (#14246)Takashi Kokubun
https://github.com/ruby/ruby/actions/runs/16995978143/job/48186652826?pr=14244
2025-08-15Skip an unstable test for macOS (#14245)Takashi Kokubun
2025-08-15Skip an unstable test for macOSTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/16983250181/job/48147338735 https://github.com/ruby/ruby/actions/runs/16994020689/job/48180211762
2025-08-15Increase timeout for a flaky testTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/16983250181/job/48147338699
2025-08-15Don't change Encoding.default_internal in assert_raise_with_messagePeter Zhu
For most tests (except two), we don't need to change Encoding.default_internal in assert_raise_with_message. We're trying to run the test suite across multiple Ractors and modifying Encoding.default_internal can cause other concurrently running tests to fail.
2025-08-14Increase timeout for a flaky test (#14233)Takashi Kokubun
https://github.com/ruby/ruby/actions/runs/16977882022/job/48131284556
2025-08-14Skip an unstable Ractor test for macOS (#14231)Takashi Kokubun
https://github.com/ruby/ruby/actions/runs/16977094733/job/48128667252?pr=14229
2025-08-14Increase timeout for a flaky test (#14228)Takashi Kokubun
https://github.com/ruby/ruby/actions/runs/16974964229/job/48121382131
2025-08-14ZJIT: Look for RUBY_ZJIT_ENABLE in combo build with YJITAlan Wu
2025-08-14Skip an unstable test for s390x and windowsTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/16971197634/job/48108366805?pr=14223 https://github.com/ruby/ruby/actions/runs/16971558478/job/48109641049?pr=14223
2025-08-14Increase timeout for failing testsTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/16969921157/job/48103809963 https://github.com/ruby/ruby/actions/runs/16969655024/job/48102876839
2025-08-14[ruby/prism] Be more defensive in the parser translator lexerEarlopain
Generally I have been good about safely accessing the tokens but failed to properly guard against no tokens in places where it could theoretically happen through invalid syntax. I added a test case for one occurance, other changes are theoretical only. https://github.com/ruby/prism/commit/4a3866af19
2025-08-14Extract `ruby_api_version_name`Nobuyoshi Nakada
2025-08-13ZJIT: Implement `StringIntern` codegen (#14207)Stan Lo
* ZJIT: Add test and implement display for StringIntern HIR Co-authored-by: Emily Samp <emily.samp@shopify.com> * ZJIT: Implement StringIntern codegen Co-authored-by: Emily Samp <emily.samp@shopify.com> * ZJIT: Fix StringIntern's return type --------- Co-authored-by: Emily Samp <emily.samp@shopify.com>