summaryrefslogtreecommitdiff
path: root/spec/ruby/core/proc
AgeCommit message (Collapse)Author
2025-03-27Update to ruby/spec@5e579e2Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12984
2025-01-30Update to ruby/spec@affef93Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12679
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-07Update to ruby/spec@18032a7Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12517
2024-11-06Update to ruby/spec@54c391eBenoit Daloze
2024-03-14Update to ruby/spec@89175b2Benoit Daloze
2024-02-26Update to ruby/spec@3a510bbBenoit Daloze
2024-02-12proc.c: get rid of `CLONESETUP`Jean Boussier
[Bug #20253] All the way down to Ruby 1.9, `Proc`, `Method`, `UnboundMethod` and `Binding` always had their own specific clone and dup routine. This caused various discrepancies with how other objects behave on `dup` and `clone. [Bug #20250], [Bug #20253]. This commit get rid of `CLONESETUP` and use the the same codepath as all other types, so ensure consistency. NB: It's still not accepting the `freeze` keyword argument on `clone`. Co-Authored-By: Étienne Barrié <[email protected]>
2024-02-05Update to ruby/spec@3fc4444Benoit Daloze
2023-11-27Update to ruby/spec@c3206f6Benoit Daloze
2023-09-12Make Kernel#lambda raise when given non-literal blockAlan Wu
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 <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/8405
2023-09-04Update to ruby/spec@96d1072Benoit Daloze
2023-06-26Update to ruby/spec@30e1c35Benoit Daloze
2023-05-29Update to ruby/spec@c3677cfBenoit Daloze
2023-04-25Update to ruby/spec@7f69c86Benoit Daloze
2022-04-25Update to ruby/spec@3affe1eBenoit Daloze
2022-03-28Update to ruby/spec@aaf998fBenoit Daloze
2022-03-17Make Proc#parameters support lambda keyword for returning parameters as if ↵Jeremy Evans
lambda This makes it easier to use Proc#parameters to build wrappers. Implements [Feature #15357] Notes: Merged: https://github.com/ruby/ruby/pull/5677
2022-01-28Update to ruby/spec@902ab83Benoit Daloze
2022-01-10Update to ruby/spec@226cfdcBenoit Daloze
2022-01-06Fix spec failure on ruby 3.1Kazuhiro NISHIYAMA
Because https://github.com/ruby/ruby/pull/5148 merged after Ruby 3.1.0 released. 13241b71a50dded0a7b021ec4f2fb6a995daace9 did not fix proc spec yet. https://github.com/ruby/actions/runs/4718820699?check_suite_focus=true#step:18:173 ``` 1) Proc#parameters adds * rest arg for "star" argument FAILED Expected [[:req, :x], [:rest]] == [[:req, :x], [:rest, :*]] to be truthy but was false /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/proc/parameters_spec.rb:85:in `block (3 levels) in <top (required)>' /home/runner/work/actions/actions/snapshot-ruby_3_1/spec/ruby/core/proc/parameters_spec.rb:3:in `<top (required)>' ```
2021-12-30Add support for anonymous rest and keyword rest argument forwardingJeremy Evans
This allows for the following syntax: ```ruby def foo(*) bar(*) end def baz(**) quux(**) end ``` This is a natural addition after the introduction of anonymous block forwarding. Anonymous rest and keyword rest arguments were already supported in method parameters, this just allows them to be used as arguments to other methods. The same advantages of anonymous block forwarding apply to rest and keyword rest argument forwarding. This has some minor changes to #parameters output. Now, instead of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`. These were already used for `...` forwarding, so I think it makes it more consistent to include them in other cases. If we want to use `[:rest], [:keyrest]` in both cases, that is also possible. I don't think the previous behavior of `[:rest], [:keyrest]` in the non-... case and `[:rest, :*], [:keyrest, :**]` in the ... case makes sense, but if we did want that behavior, we'll have to make more substantial changes, such as using a different ID in the ... forwarding case. Implements [Feature #18351] Notes: Merged: https://github.com/ruby/ruby/pull/5148
2021-07-29Update to ruby/spec@b65d01fBenoit Daloze
2021-02-27Update to ruby/spec@37e52e5Benoit Daloze
2021-01-28Update to ruby/spec@8cafaa5Benoit Daloze
2020-12-21Use Integer instead of Fixnum/BignumNobuyoshi Nakada
2020-11-27Update to ruby/spec@ac878adBenoit Daloze
2020-09-152.8 -> 3.0 in specsBenoit Daloze
2020-06-27Update to ruby/spec@b6b7752Benoit Daloze
2020-06-19Implement Proc#== and #eql?Jeremy Evans
Previously, these were not implemented, and Object#== and #eql? were used. This tries to check the proc internals to make sure that procs created from separate blocks are treated as not equal, but procs created from the same block are treated as equal, even when the lazy proc allocation optimization is used. Implements [Feature #14267] Notes: Merged: https://github.com/ruby/ruby/pull/3174
2020-06-13Suppress warnings [Feature #15973]Nobuyoshi Nakada
2020-06-10Make proc/Proc.new without block an error instead of warningJeremy Evans
The warning for these was added in 2.7. Notes: Merged: https://github.com/ruby/ruby/pull/3208
2020-05-03Update to ruby/spec@032ee74Benoit Daloze
2020-02-19`Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260]Nobuyoshi Nakada
2019-12-30Fix Proc#<< specAlan Wu
[Bug #16406]
2019-12-27Update to ruby/spec@d419e74Benoit Daloze
2019-09-08Improve Proc#to_s specsBenoit Daloze
2019-08-14change Proc#to_s format ('@...' -> ' ...') (#2362)Koichi Sasada
Now Proc#to_s returns "#<Proc:[email protected]:1>". However, it is convenient to select a file name by (double-)clicking on some terminals by separating ' ' instead of '@' like "#<Proc:0x00000237a0f5f170 t.rb:1>" [Feature #16101]
2019-07-27Update to ruby/spec@875a09eBenoit Daloze
2019-06-27Update to ruby/spec@94d98ffBenoit Daloze
2019-06-27Update to ruby/spec@8d74d49Benoit Daloze
2019-05-28Update to ruby/spec@9a501a8Benoit Daloze
2019-04-27Update to ruby/spec@15c9619Benoit Daloze
2019-04-13Proc.new: change deprecation warning for clarity (issue #15539)marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-27Update to ruby/spec@e57f49ceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-20Update to ruby/spec@35a9fbaeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-11Drop whole examplesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-11Fix r66791nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-11Fix r66772nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-10proc.c: proc without blocknobu
* proc.c (proc_new): promoted lambda/proc/Proc.new with no block in a method called with a block to a warning/error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e