summaryrefslogtreecommitdiff
path: root/test/ruby/test_pattern_matching.rb
AgeCommit message (Collapse)Author
2022-02-19Find pattern is no longer experimental [Feature #18585]Kazuki Tsujimoto
2021-10-22Disable did_you_mean in TestPatternMatchingYuki Nishijima
2021-08-19Allow omission of parentheses in one line pattern matching [Feature #16182]Kazuki Tsujimoto
2021-08-15Show verbose error messages when single pattern match failsKazuki Tsujimoto
[0] => [0, *, a] #=> [0] length mismatch (given 1, expected 2+) (NoMatchingPatternError) Ignore test failures of typeprof caused by this change for now.
2021-07-17One-line pattern matching is no longer experimentalKazuki Tsujimoto
https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20210715Japan.md#feature-17724-make-the-pin-operator-support-instanceclassglobal-variables-jeremyevans0
2021-07-15Add pattern matching pin support for instance/class/global variablesJeremy Evans
Pin matching for local variables and constants is already supported, and it is fairly simple to add support for these variable types. Note that pin matching for method calls is still not supported without wrapping in parentheses (pin expressions). I think that's for the best as method calls are far more complex (arguments/blocks). Implements [Feature #17724] Notes: Merged: https://github.com/ruby/ruby/pull/4502
2021-03-21Pattern matching pin operator against expression [Feature #17411]Kazuki Tsujimoto
This commit is based on the patch by @nobu.
2021-01-19test/ruby/test_pattern_matching.rb: Avoid a warningYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu2004/ruby-master/log/20210119T033003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20210119T033003Z/ruby/test/ruby/test_pattern_matching.rb:798: warning: assigned but unused variable - x ```
2021-01-19Mark pattern labels as unremoveableVladimir Dementyev
Peephole optimization doesn't play well with find pattern at least. The only case when a pattern matching could have unreachable patterns is when we have lasgn/dasgn node, which shouldn't happen in real-life. Fixes https://bugs.ruby-lang.org/issues/17534
2020-12-23Make NoMatchingPatternError a subclass of StandardErrorKazuki Tsujimoto
2020-12-13Reintroduce `expr in pat` [Feature #17371]Kazuki Tsujimoto
2020-11-01Pattern matching is no longer experimentalKazuki Tsujimoto
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-06-27Suppress "assigned but unused variable" warningsKazuki Tsujimoto
2020-06-27Add #deconstruct cache to find patternVladimir Dementyev
Notes: Merged: https://github.com/ruby/ruby/pull/3104
2020-06-27Optimize array pattern matching by caching #deconstruct valueVladimir Dementyev
Notes: Merged: https://github.com/ruby/ruby/pull/3104
2020-06-14Introduce find pattern [Feature #16828]Kazuki Tsujimoto
2020-03-03Suppress an "assigned but unused variable" warningYusuke Endoh
2020-03-03Preserve `kwarg` flag and fix up f5c904c2a9Nobuyoshi Nakada
2020-03-02Suppress "assigned but unused variable" warningsYusuke Endoh
2020-03-02Allow newlines inside braced patternNobuyoshi Nakada
2020-03-01Allow trailing comma in hash patternKazuki Tsujimoto
2019-12-21test/ruby/test_pattern_matching.rb: suppress "unused variable" warningYusuke Endoh
2019-12-20Added `experimental` warning categoryNobuyoshi Nakada
[Feature #16420]
2019-11-30Make single line pattern matching void expressionNobuyoshi Nakada
Instead of returning `nil`, raise a syntax error if its value is used. [Feature #16355]
2019-11-28Raise `NoMatchingPatternError` when expr `in` pat doesn't matchNobuyoshi Nakada
* `expr in pattern` should raise `NoMatchingError` when unmatched * `expr in pattern` should return `nil`. (this is unspecified, but this feature is experimental, at all) [Feature #16355]
2019-11-19Avoid needless object allocationKazuki Tsujimoto
2019-11-10Disallow omission of parentheses/brackets in single line pattern matching ↵Kazuki Tsujimoto
[Feature #16182]
2019-11-08Define Struct#deconstruct_keysKazuki Tsujimoto
2019-11-07Disallow duplicated pattern variableKazuki Tsujimoto
2019-10-29Restore `in_kwarg` flag properlyNobuyoshi Nakada
2019-09-26[EXPERIMENTAL] Expression with modifier `in`Nobuyoshi Nakada
[Feature #15865] Notes: Merged: https://github.com/ruby/ruby/pull/2485
2019-09-01Make pattern matching support **nil syntaxKazuki Tsujimoto
2019-06-30Fixed an assertionNobuyoshi Nakada
2019-05-21Simplified the guard against old versionsNobuyoshi Nakada
2019-04-21test/ruby/test_pattern_matching.rb: add missing tests for NODE_DASGN, NODE_LASGNktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21Add missing test for p_var_refktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21Add missing tests for p_argsktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Suppress warning in assertion tookazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Suppress warnings in `make test-all`kazu
suppress "warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Define Struct#deconstructktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Introduce pattern matching [EXPERIMENTAL]ktsj
[ruby-core:87945] [Feature #14912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e