summaryrefslogtreecommitdiff
path: root/spec/ruby
AgeCommit message (Collapse)Author
2025-04-23Add a new spec for inheritedXavier Noria
Notes: Merged: https://github.com/ruby/ruby/pull/13141
2025-04-23Add a new spec for const_addedXavier Noria
Notes: Merged: https://github.com/ruby/ruby/pull/13141
2025-04-18U+036F is now alnumMari Imaizumi
0363..036F ; Alphabetic # Mn [13] COMBINING LATIN SMALL LETTER A..COMBINING LATIN SMALL LETTER X Notes: Merged: https://github.com/ruby/ruby/pull/13117
2025-04-18[Feature #20724] Bump Unicode version to 16.0.0Mari Imaizumi
Notes: Merged: https://github.com/ruby/ruby/pull/13117
2025-04-14Expose `ruby_thread_has_gvl_p`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/11975
2025-04-14Add `RUBY_VERSION_IS_3_5`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/11975
2025-04-10Document order of execution const_added vs inheritedXavier Noria
Notes: Merged: https://github.com/ruby/ruby/pull/12759
2025-04-10Restore the original order of const_added and inherited callbacksXavier Noria
Originally, if a class was defined with the class keyword, the cref had a const_added callback, and the superclass an inherited callback, const_added was called first, and inherited second. This was discussed in https://bugs.ruby-lang.org/issues/21143 and an attempt at changing this order was made. While both constant assignment and inheritance have happened before these callbacks are invoked, it was deemed nice to have the same order as in C = Class.new This was mostly for alignment: In that last use case things happen at different times and therefore the order of execution is kind of obvious, whereas when the class keyword is involved, the order is opaque to the user and it is up to the interpreter. However, soon in https://bugs.ruby-lang.org/issues/21193 Matz decided to play safe and keep the existing order. This reverts commits: de097fbe5f3df105bd2a26e72db06b0f5139bc1a de48e47ddf78aba02fd9623bc7ce685540a10743 Notes: Merged: https://github.com/ruby/ruby/pull/13085
2025-04-02Removed Solaris conditions from optional and shared directoriesHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13037
2025-04-02Removed Solaris conditions from library directoryHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13037
2025-04-02Removed Solaris conditions from core directoryHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13037
2025-03-28spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ...3.5' ↵Hiroshi SHIBATA
spec/ruby/security/cve_2020_10663_spec.rb Notes: Merged: https://github.com/ruby/ruby/pull/13004
2025-03-27Avoid array allocation for *nil, by not calling nil.to_aJeremy Evans
The following method call: ```ruby a(*nil) ``` A method call such as `a(*nil)` previously allocated an array, because it calls `nil.to_a`, but I have determined this array allocation is unnecessary. The instructions in this case are: ``` 0000 putself ( 1)[Li] 0001 putnil 0002 splatarray false 0004 opt_send_without_block <calldata!mid:a, argc:1, ARGS_SPLAT|FCALL> 0006 leave ``` The method call uses `ARGS_SPLAT` without `ARGS_SPLAT_MUT`, so the returned array doesn't need to be mutable. I believe all cases where `splatarray false` are used allow the returned object to be frozen, since the `false` means to not duplicate the array. The optimization in this case is to have `splatarray false` push a shared empty frozen array, instead of calling `nil.to_a` to return a newly allocated array. There is a slightly backwards incompatibility with this optimization, in that `nil.to_a` is not called. However, I believe the new behavior of `*nil` not calling `nil.to_a` is more consistent with how `**nil` does not call `nil.to_hash`. Also, so much Ruby code would break if `nil.to_a` returned something different from the empty hash, that it's difficult to imagine anyone actually doing that in real code, though we have a few tests/specs for that. I think it would be bad for consistency if `*nil` called `nil.to_a` in some cases and not others, so this changes other cases to not call `nil.to_a`: For `[*nil]`, this uses `splatarray true`, which now allocates a new array for a `nil` argument without calling `nil.to_a`. For `[1, *nil]`, this uses `concattoarray`, which now returns the first array if the second array is `nil`. This updates the allocation tests to check that the array allocations are avoided where possible. Implements [Feature #21047] Notes: Merged: https://github.com/ruby/ruby/pull/12597
2025-03-27Freeze $/ and make it ractor safeÉtienne Barrié
[Feature #21109] By always freezing when setting the global rb_rs variable, we can ensure it is not modified and can be accessed from a ractor. We're also making sure it's an instance of String and does not have any instance variables. Of course, if $/ is changed at runtime, it may cause surprising behavior but doing so is deprecated already anyway. Co-authored-by: Jean Boussier <jean.boussier@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/12975
2025-03-27Update to ruby/spec@5e579e2Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12984
2025-03-20Trigger `inherited` and `const_set` callbacks after const has been definedJean Boussier
[Misc #21143] [Bug #21193] The previous change caused a backward compatibility issue with code that called `Object.const_source_location` from the `inherited` callback. To fix this, the order is now: - Define the constant - Invoke `inherited` - Invoke `const_set` Notes: Merged: https://github.com/ruby/ruby/pull/12956
2025-03-19avoid platform dependent messageYO4
Notes: Merged: https://github.com/ruby/ruby/pull/12622
2025-03-19Explicitly place a regular expressionYO4
Co-authored-by: Nobuyoshi Nakada <nobu.nakada@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/12622
2025-03-19avoid platform dependent messageYO4
(Bug #21083) https://bugs.ruby-lang.org/issues/21083 Notes: Merged: https://github.com/ruby/ruby/pull/12622
2025-03-18[Bug #21094] Update nested module names when setting temporary nameNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12947
2025-03-18[Feature #19908] Update Unicode headers to 15.1.0Mari Imaizumi
Notes: Merged: https://github.com/ruby/ruby/pull/12798
2025-03-18[Feature #20702] Tests for Array#fetch_valuesNobuyoshi Nakada
2025-03-14Invoke `inherited` callbacks before `const_added`Jean Boussier
[Misc #21143] Conceptually this makes sense and is more consistent with using the `Name = Class.new(Superclass)` alternative method. However the new class is still named before `inherited` is called. Notes: Merged: https://github.com/ruby/ruby/pull/12927
2025-03-07[Bug #21174] [Bug #21175] Update rubyspecNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12879
2025-03-04Move in-place interning spec to Ruby's testsJean Boussier
Fix: https://github.com/ruby/spec/issues/1249 JRuby and TruffleRuby can't implement this behavior. While quite a lot of code out there relies on it, if it's not implemented it will simply result in sligthly less efficient code, so not the end of the world. Notes: Merged: https://github.com/ruby/ruby/pull/12850
2025-02-26Check LoadError firstNobuyoshi Nakada
The message from dlerror is not our concern.
2025-02-26Added assertion strings with Xcode 16.3 betaHiroshi SHIBATA
2025-02-25Prefer `0.000001` over `0.000001f` for timeout calculations. (#12803)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2025-02-21Use an exclusive range for `ruby_version_is`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12790
2025-02-18reject numbered parameters from Binding#local_variablesYusuke Endoh
Also, Binding#local_variable_get and #local_variable_set rejects an access to numbered parameters. [Bug #20965] [Bug #21049] Notes: Merged: https://github.com/ruby/ruby/pull/12746
2025-02-07Retry on IO::EAGAINWaitReadable when a closed socket is still not available ↵Andrew Konchin
for reading Notes: Merged: https://github.com/ruby/ruby/pull/12710
2025-02-03Move out from quarantine a Marshal.dump spec for Float (#12692)Andrii Konchyn
* Move out from quarantine a Marshal.dump spec for Float Co-authored-by: Benoit Daloze <eregontp@gmail.com> Notes: Merged-By: eregon <eregontp@gmail.com>
2025-02-02[Bug #21106] Fix tests for custom random objectNobuyoshi Nakada
When a positive integer limit is given, `rand` method of a RNG object is expected to return a value between 0 and the limit (exclusive). Fix shuffle_spec.rb like as the similar code in sample_spec.rb, and add tests for greater values. TODO: - Return a value that is equal to or greater than the limit given to the RNG object. - Extract common code about RNG objects to a shared file. Notes: Merged: https://github.com/ruby/ruby/pull/12690
2025-01-31Prefer `platform_is_not :windows`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/12682
2025-01-30Skip a new spec for Marshal#dump and Float that fails on i686Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12679
2025-01-30Update to ruby/spec@affef93Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12679
2025-01-30Handle environment where GEM_HOME is not availableHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12675
2025-01-30bin_path_spec.rb relied to available Ruby environment with after `make install`Hiroshi SHIBATA
But we stub-out GEM_HOME variable for test-bundled-gems and others on ruby/ruby. It means the installation path mismatched with GEM_HOME variable always. We can't test this example collectly. ``` 1) Gem.bin_path finds executables of default gems, which are the only files shipped for default gems FAILED Expected File.exist? "/Users/hsbt/Documents/github.com/ruby/ruby/.bundle/gems/bundler-2.7.0.dev/exe/bundle" to be truthy but was false ```
2025-01-29Add fallback for `hostname` if `uname` isn't available. (#12655)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2025-01-28Prefer `uname -n` over `hostname`. (#12647)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2025-01-24Restructured irb related example at spec/rubyHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12624
2025-01-09[Feature #6012] Extend `source_location` for end position and columnsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12539
2025-01-08Skip examples related with OpenStruct in ruby/specHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12531
2025-01-08Reapply "Suppress WIN32OLE deprecation warnings for the time being"Nobuyoshi Nakada
Revert the part of commit 10917c5cc026f839a3dcd072b6e274eed211d0f7, "Update to ruby/spec@18032a7", that discarded the previous commit.
2025-01-07Quarantine failing new specs that require investigationAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12517
2025-01-07Update to ruby/spec@18032a7Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12517
2024-12-31Fix leak in Socket#connect specBenoit Daloze
* Found by https://github.com/ruby/ruby/actions/runs/12560692556/job/35018412527?pr=12492 Notes: Merged: https://github.com/ruby/ruby/pull/12492
2024-12-28BigDecimal('0.') with bigdecimal-3.1.9 returns 0.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12480
2024-12-28Abandon connection test if off lineNobuyoshi Nakada
2024-12-26[Bug #20982] Put spaces in `ENV.inspect` results as well as `Hash`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12472