summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
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>
2025-08-13ZJIT: Fix `ObjToString` rewrite (#14196)Stan Lo
ZJIT: Fix ObjToString rewrite Currently, the rewrite for `ObjToString` always replaces it with a `SendWithoutBlock(to_s)` instruction when the receiver is not a string literal. This is incorrect because it calls `to_s` on the receiver even if it's already a string. This change fixes it by: - Avoiding the `SendWithoutBlock(to_s)` rewrite - Implement codegen for `ObjToString`
2025-08-13imemo_fields: store owner object in RBasic.klassJean Boussier
It is much more convenient than storing the klass, especially when dealing with `object_id` as it allows to update the id2ref table without having to dereference the owner, which may be garbage at that point.
2025-08-13Add link to Ruby options doc in help textPeter Zhu
Adds link to https://docs.ruby-lang.org/en/master/ruby/options_md.html in Ruby help text (-h and --help).
2025-08-12ZJIT: Prepare non-leaf calls for SetGlobal (#14197)Stan Lo
When trace_var is used, setting a global variable can cause exceptions to be raised. We need to prepare for that.
2025-08-12Allow encodings to be autoloaded through transcoding functionsLuke Gruber
Make sure VM lock is not held when calling `load_transcoder_entry`, as that causes deadlock inside ractors. `String#encode` now works inside ractors, among others. Atomic load the rb_encoding_list Without this, wbcheck would sometimes hit a missing write barrier. Co-authored-by: John Hawthorn <john.hawthorn@shopify.com> Hold VM lock when iterating over global_enc_table.names This st_table can be inserted into at runtime when autoloading encodings. minor optimization when calling Encoding.list
2025-08-12set.c: Store `set_table->bins` at the end of `set_table->entries`Jean Boussier
This saves one pointer in `struct set_table`, which would allow `Set` objects to still fit in 80B TypedData slots even if RTypedData goes from 32B to 40B large. The existing set benchmark seem to show this doesn't have a very significant impact. Smaller sets are a bit faster, larger sets a bit slower. It seem consistent over multiple runs, but it's unclear how much of that is just error margin. ``` compare-ruby: ruby 3.5.0dev (2025-08-12T02:14:57Z master 428937a536) +YJIT +PRISM [arm64-darwin24] built-ruby: ruby 3.5.0dev (2025-08-12T07:22:26Z set-entries-bounds da30024fdc) +YJIT +PRISM [arm64-darwin24] warming up........ | |compare-ruby|built-ruby| |:------------------------|-----------:|---------:| |new_0 | 15.459M| 15.823M| | | -| 1.02x| |new_10 | 3.484M| 3.574M| | | -| 1.03x| |new_100 | 546.992k| 564.679k| | | -| 1.03x| |new_1000 | 49.391k| 48.169k| | | 1.03x| -| |aref_0 | 18.643M| 19.350M| | | -| 1.04x| |aref_10 | 5.941M| 6.006M| | | -| 1.01x| |aref_100 | 822.197k| 814.219k| | | 1.01x| -| |aref_1000 | 83.230k| 79.411k| | | 1.05x| -| ```
2025-08-12[ruby/openssl] pkey: skip tests using invalid keys in the FIPS modeKazuki Yamaguchi
In OpenSSL's master branch, importing/loading a key in the FIPS mode automatically performs a pair-wise consistency check. This breaks tests for OpenSSL::PKey::EC#check_key and DH#params_ok? as they use deliberately invalid keys. These methods would not be useful in the FIPS mode anyway. Fixes https://github.com/ruby/openssl/issues/926 https://github.com/ruby/openssl/commit/25ad8f4bdb
2025-08-12[ruby/stringio] Fix test nameSutou Kouhei
(https://github.com/ruby/stringio/pull/139) https://github.com/ruby/stringio/commit/0edc8e22da
2025-08-11ZJIT: Implement `concatstrings` insn (#14154)Stan Lo
Co-authored-by: Alexander Momchilov <alexander.momchilov@shopify.com>
2025-08-11ZJIT: Add RubyVM::ZJIT.enabled? (#14159)Takashi Kokubun
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
2025-08-11Fix return value of setting in GC.configPeter Zhu
gc_config_set returned rb_gc_impl_config_get, but gc_config_get also added the implementation key to the return value. This caused the return value of GC.config to differ depending on whether the optional hash argument is provided or not.
2025-08-11Add NODE IN locationsS-H-GAMELINKS
Add locations to struct `RNode_IN`. memo: ```bash > ruby -e 'case 1; in 2 then 3; end' --parser=prism --dump=parsetree @ ProgramNode (location: (1,0)-(1,24)) +-- locals: [] +-- statements: @ StatementsNode (location: (1,0)-(1,24)) +-- body: (length: 1) +-- @ CaseMatchNode (location: (1,0)-(1,24)) +-- predicate: | @ IntegerNode (location: (1,5)-(1,6)) | +-- IntegerBaseFlags: decimal | +-- value: 1 +-- conditions: (length: 1) | +-- @ InNode (location: (1,8)-(1,19)) | +-- pattern: | | @ IntegerNode (location: (1,11)-(1,12)) | | +-- IntegerBaseFlags: decimal | | +-- value: 2 | +-- statements: | | @ StatementsNode (location: (1,18)-(1,19)) | | +-- body: (length: 1) | | +-- @ IntegerNode (location: (1,18)-(1,19)) | | +-- IntegerBaseFlags: decimal | | +-- value: 3 | +-- in_loc: (1,8)-(1,10) = "in" | +-- then_loc: (1,13)-(1,17) = "then" +-- else_clause: nil +-- case_keyword_loc: (1,0)-(1,4) = "case" +-- end_keyword_loc: (1,21)-(1,24) = "end" ```
2025-08-11Update test_string.rbErim Icel
2025-08-11Optimize `str_casecmp` length check using pointer endErim Icel
2025-08-09[ruby/stringio] Fix SEGV at eof? on null StringIONobuyoshi Nakada
https://github.com/ruby/stringio/commit/29b9133332
2025-08-09[ruby/stringio] Fix SEGV at read/pread on null StringIONobuyoshi Nakada
https://github.com/ruby/stringio/commit/113dd5a55e
2025-08-09[ruby/stringio] fix: prevent segfault in StringIO#seek with SEEK_ENDkoh-sh
on null device (https://github.com/ruby/stringio/pull/137) Fixes segmentation fault when calling `seek` with `SEEK_END` on null device StringIO created by `StringIO.new(nil)`. ```bash ruby -e "require 'stringio'; StringIO.new(nil).seek(0, IO::SEEK_END)" ``` I tested with below versions. ```bash [koh@Kohs-MacBook-Pro] ~ % ruby -v;gem info stringio;sw_vers ruby 3.4.5 (2025-07-16 revision https://github.com/ruby/stringio/commit/20cda200d3) +PRISM [arm64-darwin24] *** LOCAL GEMS *** stringio (3.1.2) Authors: Nobu Nakada, Charles Oliver Nutter Homepage: https://github.com/ruby/stringio Licenses: Ruby, BSD-2-Clause Installed at (default): /Users/koh/.local/share/mise/installs/ruby/3.4.5/lib/ruby/gems/3.4.0 Pseudo IO on String ProductName: macOS ProductVersion: 15.5 BuildVersion: 24F74 [koh@Kohs-MacBook-Pro] ~ % ``` https://github.com/ruby/stringio/commit/9399747bf9