aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core
Commit message (Collapse)AuthorAgeFilesLines
* IO#read always check the provided buffer is mutableJean Boussier2023-11-091-0/+26
| | | | Otherwise you can have work in some circumstance but not in others.
* Update to ruby/spec@bd7017fBenoit Daloze2023-10-3034-110/+480
|
* Windows: Prefer USERPROFILE over HOMEPATHLars Kanis2023-10-261-14/+13
| | | | | | Enable the test commented out in ruby/ruby@d0f5dc9eac78ecade459. Extracted from GH-7033, that is for initialization at start up time and this test is unrelated to it.
* M:N thread scheduler for RactorsKoichi Sasada2023-10-121-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduce M:N thread scheduler for Ractor system. In general, M:N thread scheduler employs N native threads (OS threads) to manage M user-level threads (Ruby threads in this case). On the Ruby interpreter, 1 native thread is provided for 1 Ractor and all Ruby threads are managed by the native thread. From Ruby 1.9, the interpreter uses 1:1 thread scheduler which means 1 Ruby thread has 1 native thread. M:N scheduler change this strategy. Because of compatibility issue (and stableness issue of the implementation) main Ractor doesn't use M:N scheduler on default. On the other words, threads on the main Ractor will be managed with 1:1 thread scheduler. There are additional settings by environment variables: `RUBY_MN_THREADS=1` enables M:N thread scheduler on the main ractor. Note that non-main ractors use the M:N scheduler without this configuration. With this configuration, single ractor applications run threads on M:1 thread scheduler (green threads, user-level threads). `RUBY_MAX_CPU=n` specifies maximum number of native threads for M:N scheduler (default: 8). This patch will be reverted soon if non-easy issues are found. [Bug #19842]
* [DOC] State the precision of `Process.times` as platform-definedNobuyoshi Nakada2023-10-031-27/+0
| | | | | Remove the bad example that can lead to misunderstanding as if this precision is defined in Ruby.
* Check by integer modulo instead of float stringNobuyoshi Nakada2023-10-031-2/+2
|
* Make Kernel#lambda raise when given non-literal blockAlan Wu2023-09-122-34/+46
| | | | | | | | | | | | | | | | | Previously, Kernel#lambda returned a non-lambda proc when given a non-literal block and issued a warning under the `:deprecated` category. With this change, Kernel#lambda will always return a lambda proc, if it returns without raising. Due to interactions with block passing optimizations, we previously had two separate code paths for detecting whether Kernel#lambda got a literal block. This change allows us to remove one path, the hack done with rb_control_frame_t::block_code introduced in 85a337f for supporting situations where Kernel#lambda returned a non-lambda proc. [Feature #19777] Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
* Update to ruby/spec@96d1072Benoit Daloze2023-09-0463-146/+687
|
* [Bug #19784] Fix behaviors against prefix with broken encodingNobuyoshi Nakada2023-08-261-4/+6
| | | | | | - String#start_with? - String#delete_prefix - String#delete_prefix!
* Fix support for dynamic keys. (#8273)Samuel Williams2023-08-241-0/+14
| | | * Skip RBS test.
* Quarantine a very flaky specTakashi Kokubun2023-08-231-9/+13
| | | | | | | | | | | https://github.com/ruby/ruby/actions/runs/5956398507/job/16157091112 This has been extremely flaky on macOS GitHub Actions. Benoit suggested to quarantine it if it's too problematic (it is) and there's no reasonable fix in a short time (it already took too long). So this commit follows the suggestion. We should remove revert this once rb_cloexec_open() is fixed.
* Deprecate Kernel#open and IO support for subprocess creation/forkingMike Dalessio2023-08-106-17/+114
| | | | | | | | | | | | | | | | | Deprecate Kernel#open and IO support for subprocess creation and forking. This deprecates subprocess creation and forking in - Kernel#open - URI.open - IO.binread - IO.foreach - IO.readlines - IO.read - IO.write This behavior is slated to be removed in Ruby 4.0 [Feature #19630]
* Update to ruby/spec@9e278f5Benoit Daloze2023-08-0212-25/+188
|
* `Refinement#refined_class` is now deprecatedNobuyoshi Nakada2023-07-311-1/+1
|
* Add examples of `return` in `eval`Nobuyoshi Nakada2023-07-301-0/+14
|
* Make {Nil,True,False}Class#singleton_method always raise NameErrorJeremy Evans2023-07-263-0/+45
| | | | | | | | {Nil,True,False}Class#singleton_methods always returns [] indicating that there are no singleton methods defined, so #singleton_method should be consistent with that. Fixes [Bug #11064]
* Use the caller location as default filename for eval family of methodsJean Boussier2023-07-245-23/+76
| | | | | | | | | | | | | | | | | | | [Feature #19755] Before (in /tmp/test.rb): ```ruby Object.class_eval("p __FILE__") # => "(eval)" ``` After: ```ruby Object.class_eval("p __FILE__") # => "(eval at /tmp/test.rb:1)" ``` This makes it much easier to track down generated code in case the author forgot to provide a filename argument.
* Implement Process.warmupJean Boussier2023-07-171-0/+11
| | | | | | | | | | | | [Feature #18885] For now, the optimizations performed are: - Run a major GC - Compact the heap - Promote all surviving objects to oldgen Other optimizations may follow.
* [Bug #19769] Fix range of size 1 in `String#tr`alexandre1842023-07-152-0/+18
|
* Improve ArgumentError message for Module#set_temporary_nameBenoit Daloze2023-07-061-4/+4
|
* Ensure the name given to Module#set_temporary_name is not a valid constant pathBenoit Daloze2023-07-061-2/+17
| | | | Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* Specs for Module#set_temporary_name should be in their own fileBenoit Daloze2023-07-062-49/+53
|
* Update to ruby/spec@30e1c35Benoit Daloze2023-06-26184-3306/+2347
|
* Allow setting the name of a class or module. (#7483)Samuel Williams2023-06-211-0/+49
| | | | Introduce `Module#set_temporary_name` for setting identifiers for otherwise anonymous modules/classes.
* Refactor guards for Time.new specBenoit Daloze2023-05-291-10/+13
|
* Unify error messages of rb_num2ulong and rb_num2ullPeter Zhu2023-05-291-1/+8
| | | | | The error messages were slightly different due, which causes different behaviour on 32-bit and 64-bit systems.
* Update to ruby/spec@c3677cfBenoit Daloze2023-05-2947-129/+1303
|
* Add support for pread/pwrite on windows. (#7827)Samuel Williams2023-05-242-68/+64
|
* Hash.new: print a deprecation warning when receiving keyword arguments (#7828)Jean byroot Boussier2023-05-234-5/+18
| | | | | | | | | | [Feature #19236] In Ruby 3.3, `Hash.new` shall print a deprecation warning if keyword arguments are passed instead of treating them as an implicit positional Hash. This will allow to safely introduce a `capacity` keyword argument in 3.4 Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
* Add Fiber#kill, similar to Thread#kill. (#7823)Samuel Williams2023-05-181-0/+90
|
* [Bug #19597] Freeze script nameNobuyoshi Nakada2023-05-101-2/+4
|
* marshal.c: shallow freeze user objectsJean Boussier2023-04-261-9/+7
| | | | | | When `freeze: true` argument is passed. [Bug #19427]
* Update to ruby/spec@7f6ca5bBenoit Daloze2023-04-251-1/+1
|
* Workaround CRuby adding x86_64-linux-fake in $LOADED_FEATURESBenoit Daloze2023-04-251-1/+5
|
* Update to ruby/spec@7f69c86Benoit Daloze2023-04-2577-179/+1557
|
* Allow anonymous memberless StructJeremy Evans2023-04-241-0/+14
| | | | | | | Previously, named memberless Structs were allowed, but anonymous memberless Structs were not. Fixes [Bug #19416]
* Check the precision of `getrusage` at runtimeNobuyoshi Nakada2023-04-231-1/+11
|
* Fix a guard of `Process.times`Nobuyoshi Nakada2023-04-221-8/+5
| | | | | | `GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID` clock uses `getrusage` always if available as the name states. That is if it is implemented `getrusage` is available, regardless microseconds in its results.
* Fix an example of `Process.times`Nobuyoshi Nakada2023-04-221-1/+1
| | | | | | | | Prior to commit 5806c54447439f2ba22892e4045e78dd80f96f0c, it was "at least one result with precision beyond milliseconds (with none-zero microseconds) should exist"; after this commit, "at least one result should have zero microseconds". This chance is lower than the previous condition.
* MatchData#named_captures: add optional symbolize_names keyword (#6952)Vladimir Dementyev2023-04-191-0/+12
|
* Add spec for `Warning[:performance]`Jean Boussier2023-04-171-0/+7
| | | | [Feature #19538]
* Implement ObjectSpace::WeakMap#delete and ObjectSpace::WeakKeyMap#deleteJean Boussier2023-04-152-0/+70
| | | | | | [Feature #19561] It's useful to be able to remove references from weak maps.
* * append newline at EOF. [ci skip]git2023-04-151-1/+1
|
* Add specs for ObjectSpace::WeakKeyMapJean Boussier2023-04-155-0/+161
| | | | [Feature #18498]
* Revert "Add specs for ObjectSpace::WeakKeyMap"Jean Boussier2023-04-145-151/+0
| | | | This reverts commit fce8f9f24e4903784266fc9694f86ddd930d6141.
* Add specs for ObjectSpace::WeakKeyMapJean Boussier2023-04-145-0/+151
| | | | [Feature #18498]
* [Bug #19533] Add spec of infinite range inclusionNobuyoshi Nakada2023-04-141-0/+6
|
* Revert "Fix transient heap mode"Aaron Patterson2023-04-041-11/+0
| | | | | | | | This reverts commit 87253d047ce35e7836b6f97edbb4f819879a3b25. Revert "Implement `Process.warmup`" This reverts commit ba6ccd871442f55080bffd53e33678c0726787d2.
* Implement `Process.warmup`Jean Boussier2023-04-041-0/+11
| | | | | | | | | | | | [Feature #18885] For now, the optimizations performed are: - Run a major GC - Compact the heap - Promote all surviving objects to oldgen Other optimizations may follow.
* Raise ArgumentError if IO.read is provided negative offsetJeremy Evans2023-03-241-3/+12
| | | | Fixes [Bug #19380]