summaryrefslogtreecommitdiff
path: root/spec/ruby/language
AgeCommit message (Collapse)Author
2021-07-29Update to ruby/spec@b65d01fBenoit Daloze
2021-07-17Disable spec of `pattern matching is experimental` since 3.1Kazuhiro NISHIYAMA
2021-06-02Update to ruby/spec@a0b7d0dBenoit Daloze
2021-05-12Fix handling of control/meta escapes in literal regexpsJeremy Evans
Ruby uses a recursive algorithm for handling control/meta escapes in strings (read_escape). However, the equivalent code for regexps (tokadd_escape) in did not use a recursive algorithm. Due to this, Handling of control/meta escapes in regexp did not have the same behavior as in strings, leading to behavior such as the following returning nil: ```ruby /\c\xFF/ =~ "\c\xFF" ``` Switch the code for handling \c, \C and \M in literal regexps to use the same code as for strings (read_escape), to keep behavior consistent between the two. Fixes [Bug #14367] Notes: Merged: https://github.com/ruby/ruby/pull/4495
2021-03-27Update to ruby/spec@fd6edddBenoit Daloze
2021-02-27Update to ruby/spec@37e52e5Benoit Daloze
2021-02-16Fix a spec failureKazuhiro NISHIYAMA
http://ci.rvm.jp/logfiles/brlog.trunk-test.20210216-182358 ``` 1) $LOAD_PATH.resolve_feature_path raises LoadError if feature cannot be found FAILED Expected LoadError but no exception was raised (nil was returned) /tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1275:in `block (3 levels) in <top (required)>' /tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1259:in `block in <top (required)>' /tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1258:in `<top (required)>' ```
2021-01-28Update to ruby/spec@8cafaa5Benoit Daloze
2020-12-27Update to ruby/spec@4ce9f41Benoit Daloze
2020-12-21Use Integer instead of Fixnum/BignumNobuyoshi Nakada
2020-12-13Don't emit warning when the pattern of one-line pattern matching is just a ↵Kazuki Tsujimoto
variable pattern https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20201210Japan.md#feature-17371-reintroduce-expr-in-pat-ktsj
2020-12-12spec: suppress deprecations of "lambda(&proc_block)" patternYusuke Endoh
2020-11-27Update to ruby/spec@ac878adBenoit Daloze
2020-11-13Improve error message when subclassing non-ClassJeremy Evans
Fixes [Bug #14726] Notes: Merged: https://github.com/ruby/ruby/pull/3330
2020-11-13Update to ruby/spec@b0b7f53Benoit Daloze
2020-11-07Fix indentationKazuki Tsujimoto
2020-11-07Fix and remove spec testing undefined behaviorKazuki Tsujimoto
2020-11-01Use the suppress_warning helper instead of doing it manuallyKazuki Tsujimoto
2020-11-01Suppress "One-line pattern matching is experimental" warningKazuki Tsujimoto
2020-11-01Fix Rubyspec (ruby-2.7) failuresKazuki Tsujimoto
https://github.com/ruby/ruby/runs/1337845174
2020-11-01use one-line pattern matching for warning testsKoichi Sasada
2020-10-26Assoc pattern matching (#3703)Nobuyoshi Nakada
[Feature #17260] One-line pattern matching using tASSOC R-assignment is rejected instead. Notes: Merged-By: nobu <nobu@ruby-lang.org>
2020-10-24Update to ruby/spec@4f59d86Benoit Daloze
2020-09-30Update to ruby/spec@bfd843aBenoit Daloze
2020-09-30Update to ruby/spec@9277d27Benoit Daloze
2020-09-25Disable deprecation warning by the default [Feature #16345]Nobuyoshi Nakada
And `-w` option turns it on. Notes: Merged: https://github.com/ruby/ruby/pull/3481
2020-09-152.8 -> 3.0 in specsBenoit Daloze
2020-09-15Interpolated strings are no longer frozen with frozen-string-literal: trueBenoit Daloze
* Remove freezestring instruction since this was the only usage for it. * [Feature #17104] Notes: Merged: https://github.com/ruby/ruby/pull/3488
2020-09-02Fix constant names set using const_set on a singleton classMarc-Andre Lafortune
Fixes [Bug #14895] Notes: Merged: https://github.com/ruby/ruby/pull/3502
2020-08-28Update to ruby/spec@335eb9bBenoit Daloze
2020-07-27Update to ruby/spec@07164daBenoit Daloze
2020-07-22Switch reserved for numbered parameter warning to SyntaxErrorJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/3163
2020-06-27Update to ruby/spec@b6b7752Benoit Daloze
2020-06-18Dup splat array in certain cases where there is a block argumentJeremy Evans
This makes: ```ruby args = [1, 2, -> {}]; foo(*args, &args.pop) ``` call `foo` with 1, 2, and the lambda, in addition to passing the lambda as a block. This is different from the previous behavior, which passed the lambda as a block but not as a regular argument, which goes against the expected left-to-right evaluation order. This is how Ruby already compiled arguments if using leading arguments, trailing arguments, or keywords in the same call. This works by disabling the optimization that skipped duplicating the array during the splat (splatarray instruction argument switches from false to true). In the above example, the splat call duplicates the array. I've tested and cases where a local variable or symbol are used do not duplicate the array, so I don't expect this to decrease the performance of most Ruby programs. However, programs such as: ```ruby foo(*args, &bar) ``` could see a decrease in performance, if `bar` is a method call and not a local variable. This is not a perfect solution, there are ways to get around this: ```ruby args = Struct.new(:a).new([:x, :y]) def args.to_a; a; end def args.to_proc; a.pop; ->{}; end foo(*args, &args) # calls foo with 1 argument (:x) # not 2 arguments (:x and :y) ``` A perfect solution would require completely disabling the optimization. Fixes [Bug #16504] Fixes [Bug #16500] Notes: Merged: https://github.com/ruby/ruby/pull/3157
2020-05-31Update to ruby/spec@4e486faBenoit Daloze
2020-05-26Use receiver #name rather than #inspect to build NameError messageJean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/3080
2020-05-09Fix a typo [ci skip]Kazuhiro NISHIYAMA
2020-05-03Update to ruby/spec@032ee74Benoit Daloze
2020-05-02Update to ruby/spec@d394dfdBenoit Daloze
2020-04-17Removed NIL/TRUE/FALSENobuyoshi Nakada
Deprerecated constants which had been warned since 2.4.
2020-04-10Endless method definition [Feature #16746]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2996
2020-04-10Turn class variable warnings into exceptionsJeremy Evans
This changes the following warnings: * warning: class variable access from toplevel * warning: class variable @foo of D is overtaken by C into RuntimeErrors. Handle defined?(@@foo) at toplevel by returning nil instead of raising an exception (the previous behavior warned before returning nil when defined? was used). Refactor the specs to avoid the warnings even in older versions. The specs were checking for the warnings, but the purpose of the related specs as evidenced from their description is to test for behavior, not for warnings. Fixes [Bug #14541] Notes: Merged: https://github.com/ruby/ruby/pull/2987
2020-04-03Refined "Drop support for ruby 2.4 from ruby/spec"Nobuyoshi Nakada
By using spec/mspec/tool/remove_old_guards.rb. Notes: Merged: https://github.com/ruby/ruby/pull/2997
2020-04-01Drop support for ruby 2.4 from ruby/specNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2892
2020-04-01Use FrozenError instead of frozen_error_classNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2892
2020-03-28Update to ruby/spec@ec84479Benoit Daloze
2020-03-08Do not autosplat when calling procs that accept rest and keywordsJeremy Evans
When providing a single array to a block that takes a splat, pass the array as one argument of the splat instead of as the splat itself, even if the block also accepts keyword arguments. Previously, this behavior was only used for blocks that did not accept keywords. Implements [Feature#16166] Notes: Merged: https://github.com/ruby/ruby/pull/2502
2020-03-07Fix a typoKazuhiro NISHIYAMA
2020-02-28Update to ruby/spec@41bf282Benoit Daloze
2020-02-23Warn non-nil `$/` [Feature #14240]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2920